The foreach
tag works only on arrays, and is used to loop through each key-value pair in an array.
This example loops through the numbers from 1 to 4, and stops at 3 as the limit is set to the 3rd element. The default and maximum limit is 100.
{% foreach asd in [1, 2, 3, 4] limit 3 %}
{{ asd }}
{% endforeach %}