cycle
cycleΒΆThe cycle function cycles on an array of values:
{% for i in 0..10 %}
{{ cycle(['odd', 'even'], i) }}
{% endfor %}
The array can contain any number of values:
{% set fruits = ['apple', 'orange', 'citrus'] %}
{% for i in 0..10 %}
{{ cycle(fruits, i) }}
{% endfor %}