twig for loop with keys code example
Example: twig for loop key
{% for key, user in users %}
<li>{{ key }}: {{ user.username|e }}</li>
{% endfor %}
{% for key, user in users %}
<li>{{ key }}: {{ user.username|e }}</li>
{% endfor %}