У меня проблема с Symfony2 и Twig :Я не знаю, как отобразить все поля моей сущности, которая загружается динамически. Вот мой код (ничего не отображает!!)
Контроллер:
public function detailAction($id)
{
$em = $this->container->get('doctrine')->getEntityManager();
$node = 'testEntity'
$Attributes = $em->getRepository('TestBetaBundle:'.$node)->findOneById($id);
return $this->container->get('templating')->renderResponse('TestBetaBundle:test:detail.html.twig',
array(
'attributes' => $Attributes
));
}
detail.html.twig:
{% for key in attributes %}
<p>{{ value }} : {{ key }}</p>
{% endfor %}