get loop index in for loop twig code example
Example 1: twig loop variables
{% for user in users %}
{{ loop.index }} - {{ user.username }}
{% endfor %}
Example 2: how to for loop twig
{% for letter in 'a'..'z' %}
* {{ letter }}
{% endfor %}