I want to get multiple pagination on same template. I am querying 2 different models to paginate in 2 different places of a template file file. As you have guessed if I click next page of one of both pagination, both the models fetches next page values.
I have done enough research and tried various solutions available online but none of them worked. May be i dint used them correctly.
I have figured out that if I can be able to set page no statically i can get it worked.
I want to set it like
‘page’=>1
I know we can set it like that. But if there is a param in url like
…../page:2/….
It is overriding the value i specified. Is there a way to get pages of numbers we gave no matter what is sent through URL?
Thankyou
2 Suggestion
First, you can overwrite the page number in the URL parameters, like this
The problem with this is that the URL on the page will still have the old
:pagevalue set, so…The other approach is to redirect to the same controller action, but with a different page number set (or no page number set, if you like).
Here are the docs on constructing redirects, in case you need them:
http://api.cakephp.org/class/router#method-Routerurl