tags:

views:

17

answers:

1

Hi,

i have this code:

if(sfContext::getInstance()->get('form_signin')){

     //...

}

but im getting this error:

The "form_signin" object does not exist in the current context.

Any right way to check if a variable saved in sfContext is set or not ?

Regards

Javi

+1  A: 

Simply use the "has" call rather than the get

if(sfContext::getInstance()->has('form_signin')){

     //...

}
johnwards
On a side note, sfContext should never be used like that as it's a singleton class. (so it should only be initialised once)Read: http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/:-)
Jamie