1. Go to this page and download the library: Download abraovic/php-paginator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use abraovic\phpPaginator\Paginate;
class ... {
function ... {
return $this->render(
'some.html.twig',
[
...,
'pagination' => Paginate::data(
$page, // current page
$limit, // max limit per page
$total, // total number of items
$this->get('router')->generate('_route_name', array(), true) // route link - replace _route_name with proper name
)
]
);
}
}
{{
First: [first in some other language]
Last: [last in some other language]
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.