Pagination class for the PHP Fat-Free Framework
The contents of this file are subject to the terms of the GNU General
Public License Version 3.0. You may not use this file except in
compliance with the license. Any of the license terms and conditions
can be waived if you get permission from the copyright holder.
Copyright (c) 2012 by ikkez
Christian Knuth mail@ikkez.de
Methods summary
public
|
#
__construct( $items, $limit = 10, $routeKey = 'page' )
create new pagination
Parameters
- $items
- max items or array to count
- $limit
- max items per page
- $routeKey
- the key for pagination in your routing
|
public
|
#
setLimit( $limit )
set maximum items shown on one page
set maximum items shown on one page
Parameters
|
public
|
#
setRouteKey( string $key )
set token name used in your route pattern for pagination
set token name used in your route pattern for pagination
Parameters
|
public
|
#
setRouteKeyPrefix( string $prefix )
set a prefix that is added to your page links
set a prefix that is added to your page links
Parameters
|
public
|
#
setTemplate( $template )
set path for the template file
set path for the template file
Parameters
|
public
|
#
setRange( $range )
set the range of pages, that are displayed prev and next to current page
set the range of pages, that are displayed prev and next to current page
Parameters
|
public
|
#
setCurrent( $current )
set the current page number
set the current page number
Parameters
|
public
|
#
setLinkPath( $linkPath )
set path to current routing for link building
set path to current routing for link building
Parameters
|
public static
integer|mixed
|
#
findCurrentPage( string $key = 'page' )
extract the current page number from the route parameter token
extract the current page number from the route parameter token
Parameters
Returns
integer|mixed
|
public
integer
|
#
getCurrent( )
returns the current page number
returns the current page number
Returns
integer
|
public
integer
|
#
getItemCount( )
returns the maximum count of items to display in pages
returns the maximum count of items to display in pages
Returns
integer
|
public
integer
|
#
getMax( )
get maximum pages needed to display all items
get maximum pages needed to display all items
Returns
integer
|
public
integer|boolean
|
#
getNext( )
get next page number
Returns
integer|boolean
|
public
integer|boolean
|
#
getPrev( )
get previous page number
Returns
integer|boolean
|
public
boolean|integer
|
#
getLast( )
return last page number, if current page is not in range
return last page number, if current page is not in range
Returns
boolean|integer
|
public
boolean|integer
|
#
getFirst( )
return first page number, if current page is not in range
return first page number, if current page is not in range
Returns
boolean|integer
|
public
array
|
#
getInRange( $range = null )
return all page numbers within the given range
return all page numbers within the given range
Parameters
Returns
array page numbers in range
|
public
integer
|
#
getItemOffset( )
returns the number of items left behind for current page
returns the number of items left behind for current page
Returns
integer
|
public
string
|
#
serve( )
generates the pagination output
generates the pagination output
Returns
string
|
public static
string
|
#
renderTag( $args )
magic render function for custom tags
magic render function for custom tags
Parameters
Returns
string
|