Other Tags

autoescape

The autoescape construct only change the escape mode which will be used by the processing pipeline to generate the output. Escape modes are configurable in Jtwig, check Jtwig Core > Environment documentation for more information.

{% autoescape 'html' %}
<a href="#">Link</a>
{% endautoescape %}

The escaping functionality is attached to the very end of the Jtwig rendering pipeline.

filter

The filter construct is the way apply functions the a given content. It uses the provided body as the first argument in the specified function.

{% filter lower | capitalize %}
HELLO WORLD
{% endfilter %}

The previous example will produce Hello world. As we can see, the filter specified results in the composition of two distinct functions, it will first apply the lower function to the content HELLO WORLD, producing hello world and then apply the capitalize function producing Hello world.

verbatim

The verbatim tag is usefull avoiding the specifics around Jtwig syntax, as it will not try to parse the content.

{% verbatim %}
{{ test }}
{% endverbatim %}

The output of the previous template will be {{ test }}.