user1080247
user1080247

Reputation: 1166

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

 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());

Upvotes: 2

Views: 3630

Answers (1)

Dave
Dave

Reputation: 29121

Follow the step-by-step instructions here.

Upvotes: 2

Related Questions