Have you tried reading the manual? You'll find this nice paragraph,
both in tempdocs.cakephp.org and book.cakephp.org, filed under
'components':

> You might also want to utilize other components inside a custom component.
> To do so, just create a $components class variable (just like you would in a 
> controller)
> as an array that holds the names of components  you wish to utilize.

So...

class SomeComponent extends Object {
  var $components = array('Session');

  function whatever() {
    if ($this->Session->check('foo')) {
      ..
    }
  }
}

On Mar 10, 3:14 pm, vendejp <[EMAIL PROTECTED]> wrote:
> have this in your component:
>
> function startup(&$controller){
>                 $this->controller =& $controller;
>
> }
>
> then get session by:
> $ses = $this->controller->Session;
>
> On Mar 10, 4:40 am, bob <[EMAIL PROTECTED]> wrote:
>
> > how do you get Session object from a component?
>
> > thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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