In PHP I would do this:
foreach( $array as $key => $value ) {
echo $another_array[$key];
}
I can\'t see how to do that in Twig (in Sym
<ul>
{% for value in array %}
{% set the_index = attribute(another_array, loop.index) %}
<li>{{ the_index }}</li>
{% endfor %}
</ul>
You can use the attribute function.
{{ attribute(another_array, the_index) }}
The fastest way:
{% for key,value in array %}
{{ another_array[key] }}
{% endfor %}