Loop through array in Twig
Simple:

Twig:


&lt;ul&gt;
  {% for key, icon in icons %}
    &lt;li{{ item.attributes.addClass('pos' ~ key, icon) }}&gt;
  {% endfor %}
&lt;/ul&gt;


Source:
http://twig.sensiolabs.org/doc/tags/for.html