Pagination is not working in cakephp -
my code controller:
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'));
when
pr($this->paginate['comment'] = array( 'conditions' => array('comment.post_id' => $this->params['id']))); exit;
the output array
( [conditions] => array ( [response.claim_id] => 4 ) )
but instead of finding comment related post shows post db
once tried
pr($this->paginate['comment'] = array( 'conditions' => array('comment.id' => $this->params['id']))); exit;
and result same
array ( [conditions] => array ( [response.id] => 4 ) )
can 1 suggest me why pagination not woking
use
public $paginate = array( 'paramtype' => 'querystring', 'limit' => 3, );
in controller
$this->set('comments',$this->paginate('response', array('response.claim_id' => $id)));
in function
and define paginator component in controller
Comments
Post a Comment