twig for

103

how to for loop twig -

{% for i in 0..10 %}
    * {{ i }}
{% endfor %}

twig for -

<ul>
    {% for key, user in users %}
        <li>{{ key }}: {{ user.username|e }}</li>
    {% endfor %}
</ul>

twig loop variables -

{% for user in users %}
    {{ loop.index }} - {{ user.username }}
{% endfor %}

twig for -

{% for i in 0..10 %}
    * {{ i }}
{% endfor %}

Comments

Submit
0 Comments