{if not isset} Smarty

后端 未结 3 2070
借酒劲吻你
借酒劲吻你 2021-01-03 22:12

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

相关标签:
3条回答
  • 2021-01-03 22:36
    {if ! isset($var)}
    body must be at least 30 characters. :)
    {/if}
    
    0 讨论(0)
  • 2021-01-03 22:36

    Try this.

    {if $missing_var|default:FALSE}
    NOT MISSING
    {else}
    MISSING
    {/if}
    
    0 讨论(0)
  • 2021-01-03 22:44

    Try This

    {if $var}
       Active
    {else}
       Inactive
    {/if}
    
    0 讨论(0)
提交回复
热议问题