for
¶
The Twital instruction for Twig’s for
tag is the t:for
attribute.
Loop over each item in a sequence. For example, to display a list of users
provided in a variable called users
:
<h1>Members</h1>
<ul>
<li t:for="user in users">
{{ user.username }}
</li>
</ul>
Note
For more information about the for
tag, please refer to Twig official documentation.