Answer the question
In order to leave comments, you need to log in
How to output an array in twig?
Hello.
I get data using some api, after receiving the data, I get a PHP array of the form <?php $result[1]['name']; ?>
Where $result
is the array itself, [1] is the id of the array record, ['name'] is the value of the array record.
Next, I pass this array to twig (I checked it is not empty).
How can I loop it out?
Tried like this - {{ result.i.name }} where i is the id of the array entry.
I will be very grateful for the answer.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question