Hi Heiner
Thanks for the feedback, but I still get the same result with your code:
Fatal error: Call to a member function on a non-object in
/home/linden_row/web_servers/lap/dev/app/controllers/components/locale.php
on line 377
The component has the code you recommended in its startup() method, and
I can access the Session component fine within startup(), but nowhere
else in the component.
Regards,
Langdon
kitten wrote:
> Hi,
>
> You can put this in your Component's startup() method:
>
> function startup(&$controller) {
> $this->Controller =& $controller;
> }
>
> They you can access the Session object (and all other controller data)
> through
>
> $this->Controller->Session->read('theData');
>
> Hope this helps ;-)
>
> Heiner
>
>
>
>
>
>>Hi
>>
>>I am attempting to access the Session component from inside another
>>Component.
>>
>>For instance like this:
>>
>>$someData = $this->Session->read('theData');
>>
>>
>>However when I run the page I get the following error:
>>
>>Fatal error: Call to a member function on a non-object in
>>/web_servers/dev/app/controllers/components/mycomponent.php on line 336
>>
>>
>>I have the session component set at the top of the component:
>>
>>var $components = Array ('Session');
>>
>>I am obviously missing something fundamental here. Can anyone explain
>>to me how to access the functions of one component inside another?
>>
>>Regards,
>>Langdon
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---