Php/Symfony/Symfony2/twig
提供: 初心者エンジニアの簡易メモ
変数アサイン
return $this->render('AcmeHelloBundle:Default:index.html.twig', array('name' => $name));
Hello {{ name }}!
foreach
return $this->render('AcmeHelloBundle:Default:index.html.twig', array('names' => array('taro', 'jiro')));
{% for name in names %} {{ name }}<br /> {% endfor %}