I'm facing a little problem that I need help with. I've got this php application which passes data to a twig html template.
My PHP Code generates the following (simplified):
$menuItemsWithPictures = array(
'PageName' => "page_name",
'pictures' => array('/path/to/picture1.jpg', '/path/to/picture2.jpg'),
);
In my frontend I would like to have each of the items in the $menuItemsWithPictures rendered into something like this (again, very simplified here):
<div>
<a href=PageName><!-- Taken from the PageName key in the array-->
<img src=picture1 /> <!-- taken from pictures array [0] -->
<img src=picture2 /> <!-- taken from pictures array [1] -->
</a>
</div>
I tried some variations of {% for key, value in array %}, to no avail though, because I alway ended up with the a tag being generated as often as the array is long.
Could someone point me in the right direction here, perhaps?
Greetings, derelektrischemoench