Something along these lines perhaps:
Controller:
call this and it would set the retrieved data for the view for you.
$this->set('teachers', ClassRegistry::init('Teacher')->getTeachers($parms to get teachers if needed based on limit, conditions so forth, the Tutorsession id));
Teacher Model:
getTeachers()
would be a model function to get teachers based on any normal conditions, limit, id, so forth.
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Andrew Barry
Sent: Saturday, May 24, 2014 3:32 AM
To: cake-php@googlegroups.com
Subject: Re: load 2 models in controller
I need to know how this is done . ( My example was just that).
I just want to load another tables data in on the same view as another table data (just assume the data is not related).
--
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:
Post a Comment