This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Shahiem
Hi,
Do anyone know how I use $i++ for Twig?
Something like this:
{% for post in posts %} {{ i++ }} {%endfor %}
daftspunky
See the Twig documentation on the loop variable
{% for post in posts %}
{{ loop.index }}
{%endfor %}
Last updated
1-5 of 5