is_unset
Summary
Returns TRUE if the provided variable is not set (has no value).Usage
is_unset( target )
Parameters
Name | Type | Description | Required |
---|---|---|---|
test | any | The target variable. | Yes. |
Returns
TRUE or FALSE.Description
This operator checks if the target variable is set (has a value). If it is, the operator returns FALSE, otherwise TRUE will be returned.
Examples
Example 1
{def $my_variable=true()} {if is_unset( $my_variable )} Yes. {else} No. {/if}
The following output will be produced: "No.".
Example 2
{def $my_variable=false()} {if is_unset( $my_variable )} Yes. {else} No. {/if}
The following output will be produced: "Yes.".
Balazs Halasy (05/02/2004 12:36 pm)
Ester Heylen (26/02/2010 2:25 pm)
Comments
Error Probably in Example 2
Tuesday 09 January 2007 9:16:50 am
Aurélien
{if is_unset( $my_variable )}
Yes.
{else}
No.
{/if}