目前我使用的是cakephp版本2.5.3如何自定義CakePHP分頁url?
我想改變我的cakephp分頁url。
我現在的網址是http://www.example.com/newsFeeds/ajax_news_feed/page:2
我需要http://www.example.com/newsFeeds/index/page:2
我的代碼:
<?php
echo $this->Paginator->prev(' <<' . __('Previous '), array(), null, array('class' => 'prev disabled'));
echo $this->Paginator->numbers();
//echo $this->Paginator->url(array('controller'=>'newsFeeds', 'action'=>'index'));
//echo $this->Paginator->link('Sort by title on page 5', array('controller'=>'newsFeeds', 'action'=>'index'));
echo $this->Paginator->next(__(' Next') . '>> ', array(), null, array('class' => 'next disabled'));
?>
以上分頁是列明
當我點擊2
則鏈接會到http://www.example.com/newsFeeds/ajax_news_feed/my_post/page:2
,但我需要http://www.example.com/newsFeeds/index/my_post/page:2
請告訴我如何更改分頁控制器和操作?
你嘗試做出努力routes.php文件 – Abhishek 2014-09-29 11:02:18