簡體   English   中英

如何在cakephp 1.3中為分頁添加條件

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

如何將此語句轉換為具有條件規則的分頁

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

我這樣做,但我收到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