我的控制器代码:
public $paginate = array(
'paramType' => 'querystring',
'limit' => 3,
);
$this->paginate['Comment'] = array(
'conditions' => array('Comment.post_id' => $this->params['id']));
$this->set('comments',$this->paginate('Commant'));
当我做
pr($this->paginate['Comment'] = array(
'conditions' => array('Comment.post_id' => $this->params['id']))); exit;
输出是数组
(
[conditions] => Array
(
[Response.claim_id] => 4
)
)
但是,它没有找到与帖子相关的评论,而是显示来自 db 的所有帖子
一旦我尝试过
pr($this->paginate['Comment'] = array(
'conditions' => array('Comment.id' => $this->params['id']))); exit;
结果是一样的
Array
(
[conditions] => Array
(
[Response.id] => 4
)
)
谁能告诉我为什么分页不工作