Skip to content

Added a note about the side effects of enabling both PHP and Twig #4220

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

Merged
merged 3 commits into from
Sep 16, 2014
Merged
Changes from 1 commit
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
18 changes: 18 additions & 0 deletions cookbook/templating/PHP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ shortcut to render the default ``AcmeHelloBundle:Hello:index.html.php`` template
return array('name' => $name);
}

.. caution::

Enabling the ``php`` and ``twig`` template engines simultaneously is
allowed but it will produce an important side effect in your application:
template namespaces will no longer work::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a bit more precise. They will still work in places where you talk to Twig directly (for instance all places referencing a template from another one)


public function indexAction()
{
// ...

// namespaced templates will no longer work
$this->render('@Acme/Default/index.html.twig');

// traditional template notation will work
$this->render('AcmeBundle:Default:index.html.twig');
}


.. index::
single: Templating; Layout
single: Layout
Expand Down