A controller can use more than one model. You just need to set which ones
you want on the class variable $uses:

var $uses = array('Movie', 'User');

A controller can use no table at all, you just need to leave that array
empty.

This will load both Models on each and every method (I guess) so you can
load it just where you want with loadModel (
http://api.cakephp.org/class/controller#method-ControllerloadModel ) or
ClassRegistry::init('Model') (
http://api.cakephp.org/class/class-registry#method-ClassRegistryinit ).

Then, just follow Stu's tip!

On Thu, Mar 26, 2009 at 10:57 AM, jonas <[email protected]>wrote:

>
> I wasn't refering to that particular problem.
>
> On 26 mrt, 14:54, Stu <[email protected]> wrote:
> > You cannot do that from the view, if you need to have information in
> > the view you can do this in the controller:
> >
> > $this->set('variableName',  value);
> >
> > then by using $variableName in your view.
> >
> > You can put all your user info in an array and use that in your view.
> >
> > On Mar 26, 9:43 am, jonas <[email protected]> wrote:
> >
> > > Hi,
> >
> > > Let's say I wanted to create a movietrailer website.
> > > First thing I would do is create a movie table, controller, model and
> > > view.
> > > There my movietrailer website is done!
> > > But I want to add a user auth system. So I create a users table,
> > > controller, model and view.
> >
> > > But what if I wanted to show something from the users model (some site
> > > visiting information) on the movie view ?
> >
> > > Is this way cake has support for components ?
> > > Or can I just do $this->Users->some_method(); from the movie view/
> > > controller ?
> >
> > > Regards
> >
> > > Jonas
> >
>


-- 
Éber Freitas Dias

www.eberfdias.com
www.dejamps.net

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to