Skip to content
Advertisement

Symfony2 / Twig – getting array from dynamic array key

In PHP I would do this:

JavaScript

I can’t see how to do that in Twig (in Symfony2). I’ve tried various things, but this would seem the obvious answer, but it doesn’t work. It returns a ‘Item “the_index” for “Array” does not exist in’ error.

JavaScript

Any ideas?

Advertisement

Answer

The fastest way:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement