Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Statements

Default escaper statements set or replace the default escaper for a template:

{% default_escaper_group NAME %}
{% replace_escaper_group NAME %}

Extends statements extend a template with the option to prepend, replace, append, or surround any block from an ancestor template:

{% extends PATH %}
{% block NAME %}
    CONTENT
{% parent %}
    CONTENT
{% endblock %}

Include statements include the contents of a template built using the variables from the current scope:

{% include PATH %}

If statements add branching to templates with if, elseif, and else:

{% if [let PATTERN =] EXPRESSION %}
    CONTENT
{% elseif [let PATTERN =] EXPRESSION %}
    CONTENT
{% else %}
    CONTENT
{% endif %}

Match statements add pattern matching with match and case:

{% match EXPRESSION %}
{% case PATTERN %}
    ...
{% endmatch %}

For statements bring iteration to templates with for and else:

{% for PATTERN in EXPRESSION %}
    {% if EXPRESSION %}
        {% continue %}
    {% elseif EXPRESSION %}
        {% break %}
    {% endif %}

    CONTENT
{% else %}
    CONTENT
{% endfor %}

Let statements bind the result of an expression to the variable(s) in a pattern:

{% let PATTERN = EXPRESSION %}