We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Pagination in INVO does not link to last page

Hei,

I am playing with the latest INVO and found a funny behavior. When I have like 10 product types and change the paginator-limit to 2 or so in the controller, then I can use the PREVIOUS and NEXT buttons to jump through the pages. But the very last page is not accessable with the NEXT button. There I have to use the LAST button.

Is there a fix available?



8.4k
Accepted
answer
edited May '14

Well, here's my dirty hack.

In the view, change

<?php echo Tag::linkTo(array("products/index?page=".$page->next, '<i class="icon-step-forward"></i> Next', "class" => "btn")) ?>

to

<?php $next = $page->current + 1; if($next > $page->total_pages){ $next = $page->current; } ?>

<?php echo Tag::linkTo(array("products/index?page=".$next, '<i class="icon-step-forward"></i> Next', "class" => "btn")) ?>