Friday, August 29, 2014

Paginate from linked model

Hi ,

How do I display paginate data from a linked tables.
This is data from a Tutor table but I need data from the linked lesson table which has a student_id and that lesson table is linked to the student table.
So I have a tutor to lesson link in the model and a student to lesson link in the student model.

I wasnt clear about this from the docs
http://book.cakephp.org/2.0/en/core-libraries/components/pagination.html

 $this->paginate = array( 'limit' => 1 );
      $this->Paginator->settings = $this->paginate;
      
     
    $mytutor = $this->Paginator->paginate('Tutor'); //lesson and student linked table data?
 
    $this->set('mytutor', $mytutor);

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: