The syntax you are using relates to models, not to controllers. So within the 
users_controller you can do:

$result = $this->User->Profile->find(...);

...so long as the Profile model is related to the User model.

If you want to do the same but from within the User model, you'd do this:

$result = $this->Profile->find(...);

Jeremy Burns
Class Outfit

[email protected]
http://www.classoutfit.com

On 17 Nov 2010, at 10:20, bobaso wrote:

> I'm having some troubles with PHP while working with Controllers.
> If i want to create and then use 2 controllers,when using this syntax
> it doesn't work:
> 
> $this->Controller1->Controller2->find("all"...)
> 
> Instead this works:
> 
> $this->Controller1->find("all"...)
> 
> I was thinking that maybe i need to initialise first the Controller2
> in this way:
> 
> var $users="Controller2"
> 
> and then maybe the first syntax may work,but i'm not sure.Any advice?
> 
> Thank you in advance for your help =)
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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