CakePHP custom route pagination
I would like to format my URL like so:
开发者_开发技巧/news/index/page:2
to
/news/2
I would like to achieve this result by using as less code as possible (perhaps only from routes.php?), without modifying how the PaginatorHelper behaves.
Thank you for your help!
This should work
// Add this to /app/config/routes.php
Router::connect('/news/:page', array('controller' => 'news', 'action' => 'index'));
精彩评论