\CGExtensions\querypagination

A class to assist in building a paginator navigation for the results of a query.

Summary

Methods
Properties
Constants
__construct()
get_pagelist()
get_pagehash()
$pagecount
$page
$
$
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$pagecount

$pagecount : int

The number of pages

Type

int

$page

$page : int

The current page number (one based)

Type

int

$

$ : int

pagelimit The page limit from the query object

Type

int

$

$ : int

totalroas The total matching rows for the resultset (independent of limit or offset)

Type

int

Methods

get_pagelist()

get_pagelist(int $surround) : int[]

Get a list of page numbers suitable for using in a loop to build a navigation list.

This method will use optimization to ensure that the number of items returned in the list will never grow too large

Parameters

int $surround
  • The number of page numbers to surround the current page with.

Returns

int[]

get_pagehash()

get_pagehash(int $surround) : array

Get a hash of page numbers suitable for using in a loop to build a navigation list.

Parameters

int $surround

The number of pages around the current page (and the beginning and end) to return.

Returns

array