Tutorial :How to change URL of pagination in CakePHP



Question:

I click on the next link. It shows me the URL like

http://www.domainname.com/fj_messages/index/page:2  

I want to change it like change this to

fj_messages/index/page:2  

Like message/inbox/2

Can I do like this?


Solution:1

@gaioshin WTF.. That is the worst thing I've seen with regards to custom routes.

Router::connect('message/inbox/:page', array('controller' => 'fj_messages', 'action' => 'index'), array('pass' => array('page')));  

Something like that should do it just the way you want. Check out routing for more information.

The page will be in $this->params['page'] if I remember correctly.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »