Jinja Compat Tests

Enabled engines

default filter

Template

{{ varX|d('"varX" is not defined') }}

(error) v1.10.1

Invalid filter: 'd'

v2.8.0

"varX" is not defined

(error) v3.0.6

(no output)

v2.5.0

"varX" is not defined

(error) v1.4.2

Invalid filter "d".

(error) v1.24.2

Unknown "d" filter. Did you mean "date", "round", "default", "url_encode", "json_encode", "date_modify", "convert_encoding"?

(error) v0.9.5

Unable to find filter d

Template

{{ ''|default('passed string is empty', true)  }}

(error) v1.10.1

default requires 2 arguments, 1 provided

v2.8.0

passed string is empty

(error) v3.0.6

(no output)

v2.5.0

passed string is empty

v1.4.2

passed string is empty

v1.24.2

passed string is empty

(error) v0.9.5

TwigException: default filter expects one argument

Template

{{ ''|default('passed string is empty')  }}.

(error) v1.10.1

default requires 2 arguments, 1 provided

v2.8.0

.

v3.0.6

.

v2.5.0

.

v1.4.2

passed string is empty.

v1.24.2

passed string is empty.

v0.9.5

passed string is empty.

Template

{{ vars['x']|default('"x" on "vars" is not defined') }}

(error) v1.10.1

Could not parse some characters: vars|['x']||default('"x" on "vars" is not defined')

(error) v2.8.0

'vars' is undefined

(error) v3.0.6

(no output)

v2.5.0

"x" on "vars" is not defined

v1.4.2

"x" on "vars" is not defined

v1.24.2

"x" on "vars" is not defined

v0.9.5

"x" on "vars" is not defined

Template

{{ vars.x|default('"x" on "vars" is not defined') }}

(error) v1.10.1

default requires 2 arguments, 1 provided

(error) v2.8.0

'vars' is undefined

(error) v3.0.6

(no output)

v2.5.0

"x" on "vars" is not defined

v1.4.2

"x" on "vars" is not defined

v1.24.2

"x" on "vars" is not defined

v0.9.5

"x" on "vars" is not defined

Template

{{ varX|default('"varX" is not defined') }}

(error) v1.10.1

default requires 2 arguments, 1 provided

v2.8.0

"varX" is not defined

(error) v3.0.6

(no output)

v2.5.0

"varX" is not defined

v1.4.2

"varX" is not defined

v1.24.2

"varX" is not defined

v0.9.5

"varX" is not defined