twig loop previous key code example
Example 1: how to for loop twig
{% for i in 0..10 %}
* {{ i }}
{% endfor %}
Example 2: index first twig
{{ loop.index }}
OR
{{ loop.index0 }}
{% for i in 0..10 %}
* {{ i }}
{% endfor %}
{{ loop.index }}
OR
{{ loop.index0 }}