0
我正在做一些關於在CakePHP 1.26中分頁的自學習。在CakePHP中與hasmany關聯分頁
在PostsController,我有這樣的代碼:
$this->set('views', $this->Testing->Reply->findAllBypost_id($id));
我試圖改變爲分頁目的,
代碼,這是我已經嘗試了:
$this->paginate=array('conditions'=>array('Reply.post_id'=>'0'), 'limit' => 4);
$w = $this->paginate($this->Testing->Reply);
$this->set('views', $w);
我不知道這是否是最好的方式,請評論。