CakePHP3でページネーションを作成しております。
並び替えの条件にORDERを三つ指定してますが、二ページ目以降は一番上の一つしかORDERが適用されません。
二ページ以降にも並べ替え条件を適用させるには、どのように行えば宜しいでしょうか。
宜しくお願い致します。
[EventInfosController] public $paginate = [ 'limit' => 20, 'order' => [ 'event_date' => 'DESC', 'start_time' => 'DESC', 'id' => 'ASC' ] ]; public function initialize() { parent::initialize(); $this->loadComponent('Paginator'); } /** * Index method * * @return \Cake\Network\Response|null */ public function index() { $eventInfos = $this->paginate($this->EventInfos); $this->set(compact('eventInfos')); $this->set('_serialize', ['eventInfos']); }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/09/06 03:40