twig for in code example
Example 1: twig for
<ul>
{% for key, user in users %}
<li>{{ key }}: {{ user.username|e }}</li>
{% endfor %}
</ul>
Example 2: twig for
{% for i in 0..10 %}
* {{ i }}
{% endfor %}
Example 3: twig for loop key
{% for key, user in users %}
<li>{{ key }}: {{ user.username|e }}</li>
{% endfor %}