twig set array in loop code example Example: twig for loop key {% for key, user in users %} {{ key }}: {{ user.username|e }} {% endfor %}