开发者

Symfony: how to check if a variable saved in sfContext is set or not?

开发者 https://www.devze.com 2022-12-31 17:50 出处:网络
i have this code: if(sfContext::getInstance()->get(\'form_signin\')){ //... } but im getting this error:

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开发者_JAVA百科 sfContext is set or not ?

Regards

Javi


Simply use the "has" call rather than the get

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

     //...

}
0

精彩评论

暂无评论...
验证码 换一张
取 消