I have a code on my Ticket controller that displays all of the tickets created by the logged in user:
$this->set('tickets',$this->Ticket->find('all',array('conditions'=>array('user_id'=>$this->Auth->user('id')))), $this->paginate());
It returns correct results, however, my pagination (when you view the index page) shows all the tickets created by all users (Page 1 of 1, showing 18 records out of 18 total, starting on record 1, ending on 18). The code above should only return 3 tickets when you view the index page.
Thanks in advance.
Lyman
Like this:
Now call $this->paginate instead of $this->find.
— Editing to include conditions to find.
See http://book.cakephp.org/view/1232/Controller-Setup and http://book.cakephp.org/view/1237/Custom-Query-Pagination