CakePHP 3分页
我正在尝试对我的线程进行分页 代码可以工作,但我想限制每页的帖子 我怎样才能做到这一点? 以及如何将分页绘制到我的线程视图 我的代码:CakePHP 3分页,cakephp,pagination,Cakephp,Pagination,我正在尝试对我的线程进行分页 代码可以工作,但我想限制每页的帖子 我怎样才能做到这一点? 以及如何将分页绘制到我的线程视图 我的代码: $this->paginate = [ 'contain' => 'posts' ]; $query = $this->Threads->find('all')->where(['id' => $id]); $this->set('test', $this->
$this->paginate = [
'contain' => 'posts'
];
$query = $this->Threads->find('all')->where(['id' => $id]);
$this->set('test', $this->paginate($query));
谢谢。您是否尝试过将限制选项传递给
$this->paginate
$this->paginate = [
'contain' => ['Posts'],
'limit' => 10 // limits the rows per page
];