Skip to content

Set engine=php with Template annotation #1766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cookbook/templating/PHP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down