php {如果不是 isset} Smarty
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5952778/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
{if not isset} Smarty
提问by Rami Dabain
what is the code for smarty for if (!isset($var)){
?
smarty 的代码是什么if (!isset($var)){
?
if using {if $x eq '5'} when $x is not defined in smarty , it gives an error function call 'get_template_vars' is unknown or deprecated.
. this is what i believe so far as i lost hope in trying to know where did this error come from !
如果在 smarty 中未定义 $x 时使用 {if $x eq '5'} ,则会出现错误function call 'get_template_vars' is unknown or deprecated.
。这就是我所相信的,因为我对试图知道这个错误来自哪里失去了希望!
Thanky you .
谢谢你 。
回答by Timofey Stolbov
{if ! isset($var)}
body must be at least 30 characters. :)
{/if}
回答by Vladimir Djuricic
Try this.
尝试这个。
{if $missing_var|default:FALSE}
NOT MISSING
{else}
MISSING
{/if}
回答by Anil R
Try This
尝试这个
{if $var}
Active
{else}
Inactive
{/if}