Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

! prefix referencing templates #8760

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 3 commits into from
Closed
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
Next Next commit
! prefix 3.4 docs
  • Loading branch information
silverbackdan authored Nov 28, 2017
commit 366be482149617ba76e536449113c806d6ac0173
5 changes: 5 additions & 0 deletions 5 templating/overriding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ from the bundle to ``app/Resources/AcmeBlogBundle/views/Blog/index.html.twig``
(the ``app/Resources/AcmeBlogBundle`` directory won't exist, so you'll need
to create it). You're now free to customize the template.

If you don't want to override the entire template but instead just want to
override a block, as of Symfony 3.4 you can now do with by extending the original
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually the "as of Symfony x.x, you can" are added via the versionadded blocks. Those blocks are removed with the next major I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @iltar

template using the "!" prefix. For example:
``{% extends "@!AcmeBlogBundle/layout.html.twig" %}``

.. caution::

If you add a template in a new location, you *may* need to clear your
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.