Tuesday, March 1, 2011

Re: Multiple "controllers" on a single page

On Tue, Mar 1, 2011 at 1:19 PM, Miles J <mileswjohnson@gmail.com> wrote:
> It would be a single action, all you do is grab data from all sources
> and set them into the page.
>
> public function index() {
>        $this->set('users', $this->User->find('all'));
>        $this->set('files', $this->File->find('all'));
>        $this->set('posts', $this->Post->find('all'));
> }

Sure, but User, File, and Post may not all be associated with this
controller's main model. Or the list of Posts may be by a particular
User, and the list of Users may only be a subset that are related
somehow to this one. So that may not be all there is to it.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: