This is used to set a default value for a variable. If the variable is unset or an empty string, the given default value is shown instead.

default

{{$variabele|default:'<default value>'}} 

Examples

default examples

{{$empty =""}}
{{$null = null}}
{{$boolean = true}}
{{$text = "This variabele contains a value"}}

{{$empty|default:'This variabele is empty 1'}}
{{$null|default:'This variabele is empty 12'}}
{{$boolean|default:'This variabele is empty 13'}}
{{$text|default:'This variabele is empty 14'}}


Uitkomst:
This variabele is empty 1
This variabele is empty 2
1 (true)
This variabele contains a value