I'm having some difficulties using Twig.
When I call {{ dump(photos) }} I get:
array (size=4)
0 => string 'gjdh15,jpg,200,200' (length=18)
1 => string 'gjdh13,jpg,200,200' (length=18)
2 => string 'gjdh12,jpg,200,200' (length=18)
3 => string 'gjdh10,jpg,200,200' (length=18)
When I call {{ dump(photos[0]) }} I get:
string 'gjdh15,jpg,200,200' (length=18)
However when I call {{ dump(photos[1]) }} I get an exception :
Key "1" for array with keys "0" does not exist
When it clearly does.
Is there a special way to access array values using an index in Twig? (I can't use a loop).
photoscome from? Is it really an array, or something that behaves like one?{{ dump(photos|keys) }}? You can also try{{ cycle(photos, 1) }}