CakePHP paginate and order by

后端 未结 4 745
南方客
南方客 2021-01-15 03:10

It feels like I\'ve tried everything so I now come to you.

I am trying to order my data but it isn\'t going so well, kinda new to Cake.

This is my code:

4条回答
  •  孤城傲影
    2021-01-15 03:33

    try

    $all_threads = $this->Threads->find('all', 
                array(
                    'order' => 'Threads.created'
                )
            );
            $saida = $this->paginate($all_threads,[
                'conditions' => ['Threads.hidden' => 0]
            ]);
    

提交回复
热议问题