How to add conditions in cakephp paginate query

Cakephp

Posted on 10 Oct 15 by Vickey
  637



For adding conditions in paginate query need to use Paginator settings

$this->Paginator->settings = array(
 'conditions' => array('User.role_id' => $id),
 'limit' => 10
);
$this->User->recursive = 0;
$this->set('users', $this->Paginator->paginate());

 


If this post help you reduce time to develop, you can help me to maintain this website :)
www.000webhost.com