Answers for "Twig - key value loop"

1

twig foreach key value

{% for key, user in users %}
    <li>{{ key }}: {{ user.username }}</li>
{% endfor %}
Posted by: Guest on March-13-2021
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