for-endfor block

  • For-endfor block renders the content for each item in the sequence. The example below has 5 items in the sequence as denoted by (1..5), so it loops and renders all 5 items.

Example:

{% for index in (1..5) %}
    {{index}} x 5: {{ index | times: 5}}
{% endfor %}

Output:

1 x 5: 5
2 x 5: 10
3 x 5: 15
4 x 5: 20
5 x 5: 25