There is a session helper as well as a session component.

Within a helper :

   var $helpers = array(
       'Session'
   );

   function someFunction()
   {
       echo $this->Session->read('mailcode');
   }

Within a view :

echo $session->read('mailcode');

I haven't used it in the second fashion as I only access session
information from my helpers (for no reason in particular, just worked
out that way). Theoretically it should work just as other helpers do.

Cheers,
mikee

On 17/01/07, Flexewebs <[EMAIL PROTECTED]> wrote:

Hi guys,

How do I print a session variable in a view please?

I am using the following code in the controller to write a session
variable.

$this->Session->write('mailcode', $_POST["mailcode"]);

I am wanting to specifically use the session variable within my view if
at all possible.

Thanks,

Jason
www.flexewebs.com


>


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to