![]() |
|
Provides automatic pagination generation. Modifies sql query to limit items. More...
Public Member Functions | |
Pagination ($current_page=1, $page_path=null) | |
useQuery ($select_query) | |
itemsPerPage ($items) | |
linksPerPage ($nr) | |
linkAttributes ($attributes) | |
activeLinkAttributes ($attributes) | |
setPagePath ($page_path) | |
getCurrentPage () | |
setCurrentPage ($current_page) | |
setTotalItems ($items) | |
getTotalPages () | |
paginationLinks () | |
getItems () | |
![]() | |
Dispersion () | |
emptyLayout () | |
set ($name, $value) | |
_set ($name, $value) | |
insertView ($name, $index=-1) | |
Data Fields | |
$pagination_links_per_page = 10 | |
$pagination_link_attr = array() | |
$pagination_link_attr_active = array() | |
$pagination_link_href = '' | |
$current_page = 1 | |
$items_per_page = 20 | |
$total_items = null | |
$select_query = null | |
$total_pages = null | |
![]() | |
$model_ob = null | |
$debug_ob = null | |
$_variables = array() | |
$_content = array() | |
$_content_count = 0 | |
$model | |
$debug | |
Protected Member Functions | |
getAnchorAttr ($active=false) | |
anchorLink ($i, $active=false) | |
![]() | |
requireConfigFile ($file_name, $required=false) | |
Provides automatic pagination generation. Modifies sql query to limit items.
Pagination | ( | $current_page = 1 , |
|
$page_path = null |
|||
) |
Constructor
integer | $current_page | : the current page index, > 1 |
string | $page_path | : the page url |
useQuery | ( | $select_query | ) |
Set the query to be used in order to determining the page items and adding the selection
mixed | $select_query | : the query to be used, can be either string or array of options |
itemsPerPage | ( | $items | ) |
Change the number of items to be displayed on a page
integer | $items |
linksPerPage | ( | $nr | ) |
Set the max number of pagination links per page
integer | $nr |
linkAttributes | ( | $attributes | ) |
Set link attributes
array | $attributes | : keys => attribute name, values => attribute value |
InvalidArgumentTypeException |
activeLinkAttributes | ( | $attributes | ) |
Set attributes to the active link
array | $attributes | : keys => attribute name, values => attribute value |
InvalidArgumentTypeException |
setPagePath | ( | $page_path | ) |
getCurrentPage | ( | ) |
Gets the current page
setCurrentPage | ( | $current_page | ) |
setTotalItems | ( | $items | ) |
|
protected |
Get the anchor link attributes
boolean | $active | : set to true if the link is active |
|
protected |
Returns the anchor link as text form. This function is intended to be easily
integer | $i | : the page index |
boolean | $active | : true if this is the current page |
getTotalPages | ( | ) |
paginationLinks | ( | ) |
Prints the pagination links usign the helper functions above
getItems | ( | ) |
$pagination_links_per_page = 10 |
int : Total allowed links per page
$pagination_link_attr = array() |
array : Attributes for the pagination link
$pagination_link_attr_active = array() |
int : Attributes for the active pagintion link
$pagination_link_href = '' |
int : Path to the current page, without the counter
$current_page = 1 |
int : Page counting starts from 1
$items_per_page = 20 |
int : Maximum number of items per page
$total_items = null |
int : Total number of items
$select_query = null |
mixed : Selection query, can be either options, either string
$total_pages = null |
int : Stores the number of pages the query has