cPager Basic pager class without presentation logic

author Timo A. Hummel

 Methods

Constructor Function Initializes the pager

cPager($items, $itemsPerPage, $currentPage) 

Parameters

$items

int Amount of items

$itemsPerPage

int Items displayed per page

$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

 

$_currentPage : integer
access private
 

$_itemPadding : integer
access private
 

$_items : integer
access private
 

$_itemsPerPage : integer
access private
 

$_nextItems : integer
access private
 

$_previousItems : integer
access private