Answers for "twig foreach witn key => name"

1

twig foreach key value

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

Browse Popular Code Answers by Language