Class Pagination

Description

A simple library to handle calculating pagination values and returning a set of pagination links to output.

Located in /class.pagination.php (line 24)


                
			
Method Summary
static array Generate (string $sLink, integer $iStart, integer $iPerPage, integer $iTotalResults, integer $iLinksShown)
Methods
static method Generate (line 66)

Generates an array of pagination data based on the supplied arguments. This array

contains an array of individual page links to show, as well as a previous link (if there is a previous page) and a next link (if there is a next page). The returned array is in the format of:

Array( links => Array( Array( page => 1, // denotes the page number link => '?page=1' // denotes the link for the page ), Array( page => 2, // denotes the page number link => '' // empty if this is the current page ), Array( page => 3, // denotes the page number link => '?page=3' // denotes the link for the page ), ), next => Array( // empty if no next link page => 3, // denotes the page number link => '?page=3' // denotes the link for the page ), previous => Array( // empty if no previous link page => 1, // denotes the page number link => '?page=1' // denotes the link for the page ) )

  • return: An array of pagination data
  • access: public
static array Generate (string $sLink, integer $iStart, integer $iPerPage, integer $iTotalResults, integer $iLinksShown)
  • string $sLink: The URL for each pagination link, containing a %s to denote where to place the page number for each page
  • integer $iStart: The starting page number
  • integer $iPerPage: The number of elements to show per page
  • integer $iTotalResults: The total number of elements to be paginated
  • integer $iLinksShown: The number of pagination links shown at a given time

Documentation generated on Thu, 25 Feb 2010 15:59:41 -0500 by phpDocumentor 1.4.3