cPager Basic pager class without presentation logic

author Timo A. Hummel

 Methods

Constructor Function Initializes the pager

cPager(\$items $items, \$itemsPerPage $itemsPerPage, \$currentPage $currentPage) 

Parameters

$items

\$items

int Amount of items

$itemsPerPage

\$itemsPerPage

int Items displayed per page

$currentPage

\$currentPage

int Defines the current page

Returns the amount of pages.

getMaxPages() : int

Returns

intPage count

Returns an array with the pager structure.

getPagesInRange() : array

Array format: Key : Page Number Value: | for "...", "current" for the current item, page number otherwise

Returns

arrayPager structure

Returns if the currentPage pointer is the first page.

isFirstPage() : boolean

Returns

booleanTrue if we're on the first page.

Returns if the currentPage pointer is the last page.

isLastPage() : boolean

Returns

booleanTrue if we're on the last page.

 Properties

 

Current page

$_currentPage : integer

access private
 

Item padding (before and after the current item)

$_itemPadding : integer

access private
 

Amount of items

$_items : integer

access private
 

Items per page

$_itemsPerPage : integer

access private
 

Items on the right side

$_nextItems : integer

access private
 

Items on the left side

$_previousItems : integer

access private