Skip to main content

default

The default filter will set a default value for a value that is undefined or empty.

{{ var|default('var is not defined') }}

{{ var.foo|default('foo item on var is not defined') }}

{{var['foo']|default('foo item on var is not defined') }}

{{ ''|default('passed var is empty') }}