From 85136eed2d3d84321f73a2a49c66b4707f4844b8 Mon Sep 17 00:00:00 2001 From: Tom Van Looy Date: Sun, 30 Sep 2012 10:47:23 +0300 Subject: [PATCH] Set engine=php with Template annotation --- cookbook/templating/PHP.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cookbook/templating/PHP.rst b/cookbook/templating/PHP.rst index b8eb687872d..254538fa1d4 100644 --- a/cookbook/templating/PHP.rst +++ b/cookbook/templating/PHP.rst @@ -57,6 +57,20 @@ below renders the ``index.html.php`` template:: return $this->render('AcmeHelloBundle:Hello:index.html.php', array('name' => $name)); } +Or, you can use the @Template() annotation to make it render the default "AcmeHelloBundle:Hello:index.html.php" template:: + + // src/Acme/HelloBundle/Controller/HelloController.php + + // ... + + /** + * @Template(engine="php") + */ + public function indexAction($name) + { + return array('name' => $name); + } + .. index:: single: Templating; Layout single: Layout