Answers for "for loop with index twig"

2

foreach twig

{% for user in users %}
        <li>{{ user.username|e }}</li>
    {% endfor %}
Posted by: Guest on July-14-2020
0

twig for loop key

{% for key, user in users %}
	<li>{{ key }}: {{ user.username|e }}</li>
{% endfor %}
Posted by: Guest on July-09-2020

Browse Popular Code Answers by Language