for each loop in twig code example
Example 1: foreach twig
{% for user in users %}
<li>{{ user.username|e }}</li>
{% endfor %}
Example 2: twig for
<ul>
{% for key, user in users %}
<li>{{ key }}: {{ user.username|e }}</li>
{% endfor %}
</ul>