twig key code example
Example 1: twig foreach
{% for key, value in array %}
{{ key }}: {{ value }}
{% endfor %}
Example 2: how to for loop twig
{% for letter in 'a'..'z' %}
* {{ letter }}
{% endfor %}
{% for key, value in array %}
{{ key }}: {{ value }}
{% endfor %}
{% for letter in 'a'..'z' %}
* {{ letter }}
{% endfor %}