ez.no / exponential / documentation / reference / template operators / variables / is_boolean
$input|is_boolean( test )
| Name | Type | Description | Required |
|---|---|---|---|
| test | any | Variable to check. | only of input is omitted |
true or false, see description for details.
This operator simply checks if a variable is a boolean or not. The operator returns true if the input or the first parameter is a boolean. If both input and parameter are supplied, it is the parameter that will be evaluated.
{let my_variable=true your_variable="Moron."} {$my_variable|is_boolean( $your_variable )} {/let}
The example above returns false.
{let my_variable=true your_variable="Moron."} {$your_variable|is_boolean( $my_variable )} {/let}
The example above returns true.
log in or create a user account to comment.
Comments