The empty function can be used to check if a variable is set and does not contain the value 0.

empty

{{empty($text)}}

Examples

empty example

{{$variabele1 = ""}}
{{$variabele2 = 0}}


{{if empty($variabele1) && empty($variabele2) && empty($variabele3)}}
   variabele 1, 2 and 3 are empty
{{else}}
   1 or all variables are set with a value
{{/if}}


Output:

variabele 1, 2 and 3 are empty

In certain situations, it may also be desirable to check if a variable is filled;

Not empty

{{$variabele1 = ""}}
{{$variabele2 = 0}}


{{if !empty($variabele1) AND !empty($variabele2) AND !empty($variabele3)}}
   variabele 1, 2 and 3 are set with a value
{{else}}
   1 or all variables are empty
{{/if}}


Output:

1 or all variables are empty