Tests
Test: 2-items
Template
{% for i in rows %}
{{ cycle(items, i) }}
{% endfor %}
Data
{
"items": ["odd", "even"],
"rows": [1, 2, 3, 4, 5]
}
Output Django (error) v1.10.1
Could not parse the remainder: '(items, i)' from 'cycle(items, i)'
Output Jinja2 (error) v2.8.0
'cycle' is undefined
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks (error) v2.5.0
[Line 1, Column 6]
Error: Unable to call `cycle`, which is undefined or falsey
Output Swig (error) v1.4.2
(no output)
Output Twig v1.24.2
even
odd
even
odd
even
Output Twigjs v0.9.5
even
odd
even
odd
even
Test: 3-items
Template
{% for i in rows %}
{{ cycle(items, i) }}
{% endfor %}
Data
{
"items": ["apple", "orange", "banana"],
"rows": [1, 2, 3, 4, 5]
}
Output Django (error) v1.10.1
Could not parse the remainder: '(items, i)' from 'cycle(items, i)'
Output Jinja2 (error) v2.8.0
'cycle' is undefined
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks (error) v2.5.0
[Line 1, Column 6]
Error: Unable to call `cycle`, which is undefined or falsey
Output Swig (error) v1.4.2
(no output)
Output Twig v1.24.2
orange
banana
apple
orange
banana
Output Twigjs v0.9.5
orange
banana
apple
orange
banana