Mauro Zadunaisky
Mauro Zadunaisky

Reputation: 828

cakephp pagination: how to set a different 'page' parameter

Is there any way to configure a different param for the current page number?

for example, I have this paginated url:

http://localhost/petproject/posts/index/page:2

And I would like to have the url like this:

http://localhost/petproject/posts/index/my_custom_page_param:2

Thank you!

Upvotes: 0

Views: 1235

Answers (1)

floriank
floriank

Reputation: 25698

You could simply use the router to transform the URL into something else that matches your needs by adding a rewrite rule for that URL. Without researching it further I think this is the most easy solution.

Another one might be to check in Controller::beforeFilter() if your custom named arg is set and copy/set it to params['named']['page'].

Or extend the Paginator component and create your customized version of it.

Upvotes: 1

Related Questions