1. Go to this page and download the library: Download dotzero/ypaginator 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/ */
dotzero / ypaginator example snippets
$total = 100; // Total items
$perpage = 10; // Items per page
$current = 5; // Current page
$neighbours = 2; // Neighbours links beside current page
$y = new \dotzero\YPaginator($total, $perpage, $current);
$paginator = $y
->setNeighbours($neighbours)
->setUrlMask('#num#')
->setUrlTemplate('/foo/page/#num#')
->getPaginator();
print_r($paginator);