1. Go to this page and download the library: Download forrest79/pagination 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/ */
class Paginator extends Nette\Utils\Paginator
{
public function pages(): array
{
if ($this->getPageCount() === null) {
throw new InvalidArgumentException('We need page count set to generate pages list');
}
return Forrest79\Pagination\PagesFactory::logarithmic($this->getPageCount(), $this->getPage(), 10);
}
}