V
V
vlad_lutsky2017-10-24 13:41:25
Laravel
vlad_lutsky, 2017-10-24 13:41:25

How to iterate over values ​​correctly in twig?

There is a test with other sub objects on the example - {{ test.0.CODE_CLIENT }}
How can I use
{% for %}
{% endfor %}
Iterate over this array if 0 -> 1 -> 2 -> 3 changes

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Demian Smith, 2017-10-24
@vlad_lutsky

<ul>
{% for testItem in test %}
        <li>{{ testItem.CODE_CLIENT }}</li>
{% endfor %}
</ul>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question