Reputation: 423
public function search() {
$this->loadmodel('Usermgmt.User');
if ($this->request -> isPost()) {
$this->User->set($this->data);
$keyword=$this->data['Doctors']['search'];
$this->paginate['limit'] = 3;
$result = $this->paginate('User',array('conditions'=>$cond));
$this->set('result', $result);
}
here where cause shows Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'conditions' in 'where clause' it is cakephp-2.4.5
Upvotes: 0
Views: 451
Reputation: 595
The second parameter for paginate is $conditions therefore:
$result = $this->paginate('User', $cond);
Here's a further example:
$data = $this->Paginator->paginate(
'Recipe',
array('Recipe.title LIKE' => 'a%')
);
There's more information about pagination in the book.
Upvotes: 1