I derive an array:
$data= array('text' => 'first', 'text2' => 'second'); return $this->render('SomeBundle:Default:index.html.twig', array('data' => $data)); Template:
{% for qdata in data %} {{ qdata.text }} {% endfor %} Mistake:
Impossible to access an attribute ("text") on a string variable ("first") in SomeBundle: Default: index.html.twig at line 2
While the following pattern
{% for qdata in data %} {{ data.text }} {% endfor %} Displays
second
What is the problem?