简体   繁体   English

如何在cakephp 1.3中为分页添加条件

[英]how to add condition to pagination in cakephp 1.3

how to convert this statment to pagination with condition rules如何将此语句转换为具有条件规则的分页

  $comment = $this->Article->Comment->find('all',
            array('conditions' =>
    array('Comment.article_id' => $id, 'Comment.status' => 1))); 

i do this but i get parce error我这样做,但我收到parce错误

 var $paginate = array(
             'limit' => 5,
             'page' => 1,
             'order' => array('Comment.created'=>'desc'),
             'conditions' => array('Comment.article_id' => $id, 'Comment.status' => 1)
             );
$this->Article->Comment->recursive = 1;

this->set('comment', $this->paginate());

按照此处的分步说明进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM