twig loop array key value 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 %}