{if not isset} Smarty

早过忘川 提交于 2019-11-30 01:07:22

问题


what is the code for smarty for 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 !

Thanky you .


回答1:


{if ! isset($var)}
body must be at least 30 characters. :)
{/if}



回答2:


Try this.

{if $missing_var|default:FALSE}
NOT MISSING
{else}
MISSING
{/if}



回答3:


Try This

{if $var}
   Active
{else}
   Inactive
{/if}


来源:https://stackoverflow.com/questions/5952778/if-not-isset-smarty

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!