开发者

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'));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜