Cakephp ページネーションのレンダリングの問題。私はcakephp 2.0.6を使用しています。他のアクションからページをレンダリングしようとすると、うまくいきます。しかし、次のページに移動しようとすると、問題が発生します
私は次の機能を持っています
public function admin_index()
{
//Function listing
}
すべてのタイプのユーザー (サポート、従業員など) に同じ機能が必要です。そこで、次のように setAction メソッドを使用しました
public function support_index()
{
$this->setAction('admin_index');
$this->render('admin_index');
}
そして、私のページネーションコードは次のとおりです:
echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
echo $this->Paginator->numbers(array('separator' => ''));
echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
しかし、次のページに移動しようとすると、次のような URL
http://www.example.com/support/users/admin_index/page:2
http://www.example.com/employee/users/admin_index/page:2
ただし、次の出力が必要です。
http://www.example.com/support/users/index/page:2
http://www.example.com/employee/users/index/page:2
問題は $this->setAction('admin_index'); です。私は思う..誰もが感謝するのに役立ちます