ez.no / exponential / documentation / reference / template operators / variables / is_null
$input|is_null( test )
| Name | Type | Description | Required |
|---|---|---|---|
| test | any | Variable to test. | if input is omitted |
true or false, see description below.
This operator simply checks if a variable contains a null-value or not. The operator returns true if the input or the first parameter is null. Note: The integer 0 is not the same as 'null', if you want to test for 0 use the following instead:
{$var|eq( 0 )}
or
{eq( $var, 0 )}
If both input and the first parameter is supplied, it is the parameter that will be evaluated.
{let my_variable="This is the police!"} {$my_variable|is_null} {/let}
The example above returns false.
log in or create a user account to comment.
Comments