I’m using symfony2 and have accessed an entity using a doctrine query, which I then pass to my twig template. This entity has variables that I would like to loop through without having to explicitly name each one. Is there a way I can do this with twig or should I try a different design?
Share
Twig documentation says:
So it should work as long as you implement one of the Traversable interfaces (IteratorAggregate or Iterator).