Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Paginator's "next" can't link to the last page

Devtools' scaffold generated this code for me:

$paginator = new Paginator(array(
    "data" => $products,
    "limit"=> 10,
    "page" => $numberPage
));

$this->view->page = $paginator->getPaginate();

But I found that the $page->next can't link to the last page

For example:

assume that the total_pages is 5
then when I'm in page 4, the $page->next will print 4, not 5


I did more tests with 5 items, when

limit = 1 : wrong
limit = 2 : wrong
limit = 3 : Correct
limit = 4 : wrong

so... when your last page has only 1 item left, the next page can't link appropriately..

I think it's a bug
or did I do something wrong?? The code is devtool generated for me..



924
Accepted
answer

Okay, it's a bug

and will be fixed in 1.3.3