Skip to content

Commit b68f6d6

Browse files
tvlooyweaverryan
authored andcommitted
Set engine=php with Template annotation
1 parent 95d8cd7 commit b68f6d6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cookbook/templating/PHP.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ below renders the ``index.html.php`` template::
5757
return $this->render('AcmeHelloBundle:Hello:index.html.php', array('name' => $name));
5858
}
5959

60+
Or, you can use the @Template() annotation to make it render the default "AcmeHelloBundle:Hello:index.html.php" template::
61+
62+
// src/Acme/HelloBundle/Controller/HelloController.php
63+
64+
// ...
65+
66+
/**
67+
* @Template(engine="php")
68+
*/
69+
public function indexAction($name)
70+
{
71+
return array('name' => $name);
72+
}
73+
6074
.. index::
6175
single: Templating; Layout
6276
single: Layout

0 commit comments

Comments
 (0)