cPager Basic pager class without presentation logic

author Timo A. Hummel

 Methods

Constructor Function Initializes the pager

__construct($items, $itemsPerPage, $currentPage) 

Parameters

$items

int Amount of items

$itemsPerPage

int Items displayed per page

$currentPage

int Defines the current page

Returns the current page

getCurrentPage() 

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 
private integer
access private
 

$_itemPadding 
private integer
access private
 

$_items 
private integer
access private
 

$_itemsPerPage 
private integer
access private
 

$_nextItems 
private integer
access private
 

$_previousItems 
private integer
access private