Add output

This commit is contained in:
Katharina Luthe
2022-12-15 08:58:22 +01:00
committed by Fabien Potencier
parent 2ae70b5b9c
commit 1e3b126cf2
+27
View File
@@ -11,6 +11,17 @@ The ``cycle`` function cycles on an array of values:
{% for year in start_year..end_year %}
{{ cycle(['odd', 'even'], loop.index0) }}
{% endfor %}
{# outputs
odd
even
odd
even
odd
even
#}
The array can contain any number of values:
@@ -21,6 +32,22 @@ The array can contain any number of values:
{% for i in 0..10 %}
{{ cycle(fruits, i) }}
{% endfor %}
{# outputs
apple
orange
citrus
apple
orange
citrus
apple
orange
citrus
apple
orange
#}
Arguments
---------