twig for key value array code example
Example 1: twig for
{% for key, user in users %}
- {{ key }}: {{ user.username|e }}
{% endfor %}
Example 2: twig get array key name
{% for key, value in array %}
{{ key }} - {{ value }}
{% endfor %}