any body please answer to this .....

how can we use the Session helper inside component file ?

Thanks in advance

On Jul 18, 12:18 pm, web <[EMAIL PROTECTED]> wrote:
> Iam using cakephp1.2,  and  have created a custom component for
> messaging purpose . but amnotable to use $this->Session->read() or
> $this->Session->delete()insidemy class.
> These  codes creates an error like this "Call to a member function on
> a non-object ". So  I have to use the conventional phpsessioncodeinsidemy 
> componentfile.
>
> Can anyone tell me how to getSessionhelperinsidecomponent ?
>
> here is my code
> <?php
> class MessageComponent extends Object
> {
>         function getMessage()
>         {
>                 $message = '';
>
>                 $msg = $this->Session->read('message');
>                 $this->Session->delete('message');
>                 if($msg != "")
>                 {
>                         switch($msg)
>                         {
>                          $message= ...........
>                         }
>                }
>
> return $message;
>
> }
> }
>
> Thanks in advance .
--~--~---------~--~----~------------~-------~--~----~
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