Hey,
I don't know if this could help : https://github.com/Zheness/Pagination, it's an old project.
The documentation is not in english (sorry), but I give code examples.
I didn't tested but this could work for you :
// [...]
$maxElements = 20;
$paginator = new \Phalcon\Paginator\Adapter\Model([
"data" => Albums::find(),
"limit" => $maxElements,
"page" => (int) $this->request->getQuery('page', 'int'),
]);
$albumsPaginator = $paginator->getPaginate();
if ($albumsPaginator->total_pages > 1) {
$pagination = new Pagination(); // here is my class
$pagination->setCurrentPage($albumsPaginator->current);
$pagination->setNbElementsInPage($maxElements);
$pagination->setNbMaxElements($albumsPaginator->total_items);
$pagination->setUrl("/album/page/{i}");
$this->view->pagination = $pagination->renderBootstrapPagination();
}
$this->view->albumsPaginator = $albumsPaginator;
// [...]
$pagination
will contains the HTML pagination as you want, and $albumsPaginator
the Phalcon paginator.
The class render with bootstrap, but you can override it.