g0rn
Well-known member
This is a simple add-on that creates "/pagenav" page with sample <xen:pagenav> tag so you can see how to use pagenavs in your add-ons.
<xen:pagenav> uses the following syntax:
where:
$page is current page number
$itemsPerPage is a number of items shown on one page
$totalItems is a number of items on all pages
Inside the controller you can get current page number by using
It gets 'page' parameter from the URL and filters it to ensure it is an unsigned integer. Then you can pass $page to the model to get results you want.
To install this add-on copy PageNavigation folder to your library folder and import the xml file. You can access that sample page by pointing your browser to http://your-xenforo-installation/pagenav (or http://your-xenforo-installation/index.php?pagenav if you have SEO friendly URLs disabled).
<xen:pagenav> uses the following syntax:
HTML:
<xen:pagenav link="pagenav" page="{$page}" perpage="{$itemsPerPage}" total="{$totalItems}" />
$page is current page number
$itemsPerPage is a number of items shown on one page
$totalItems is a number of items on all pages
Inside the controller you can get current page number by using
PHP:
$page = $this->_input->filterSingle('page', XenForo_Input::UINT);
To install this add-on copy PageNavigation folder to your library folder and import the xml file. You can access that sample page by pointing your browser to http://your-xenforo-installation/pagenav (or http://your-xenforo-installation/index.php?pagenav if you have SEO friendly URLs disabled).