Paginage for any content. It is used to create paginate, configuring it via input parameters. Paginate don't support total number of pages, moreover it is not recommended to count all records - it slows down the site. To correctly determine last page we need to pass number of available records on the current page plus one - so we always know if next page is available.
Two types of paginate presentation is supported:
- getPaginate() - to get default paginate, it is better to use it on the whole page.
- getSimplePaginate() - to get limited paginate, it is better to use in some boxes, where availabel space is limited or for ajax paginate.
The list of available input parameters:
Parameters:
- start - position of the first item.
- num - number of available items on the page, it should be number of items per page + 1 (+1 is needed to correctly determine last page). It is possible to set this value automatically
- See also
- setNumFromDataArray.
- per_page - number of items displayed on the page.
- page_url - page URL to go through pages, special markers are automatically replaced.
- on_change_page - JavaScript code to be called on change page.
- info - display info.
- view_all_url - URL for 'view all' page. This url is not showed by default. It is convinient to use with
- See also
- getSimplePaginate.
- view_all_caption - optional caption for 'view all' link.
Available markers to replace in 'page_url' and 'on_change_page' parameters:
- {per_page} - current number of items to display per page.
- {start} - the number to display items starting from.
Example of usage:
'start' => 0,
'num' => 11,
'per_page' => 10,
'on_change_page' => 'changePage({start}, {per_page})'
));
$oPaginate->getPaginate();
Definition BxDolPaginate.php:64
Memberships/ACL: Doesn't depend on user's membership.
Alerts: no alerts available