Okay, I guess I'll stop trying, thanks ;). On a slightly related note.
I just realized that I can't access a child's model functions.
Example, I have a User that hasMany calendars and the following works
from the User controller:
$this->User->Calendar->find()
I assume find() is a model function, however, it doesn't seem to work
when I try calling a custom function that I define in the Calendar's
model:
$this->User->Calendar->isAdmin($id);
Anyone know what I'm doing wrong here?
Thanks,
Dave
On Jan 9, 1:27 pm, "Pablo Viojo" <[EMAIL PROTECTED]> wrote:
> You shuldn't try to access session information from within a model, instead
> try passing it from the controller as a parameter. Example:
>
> Model User:
>
> function getUserInfo($user_id){
> ...
>
> }
>
> Controller:
>
> User->getUserInfo($this->Session->read("logged_user_id"));
>
> Regards,
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]://pviojo.net
>
> On Jan 9, 2008 4:31 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > I have a model function that is dependent on data retrieved from the
> > session and I can't figure out how to retrieve it. Using $this-
> > >Session->read('User') results in: Undefined property: User::
> > $Session.
>
> > Anyone know?
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]://pviojo.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---