@@ -270,11 +270,9 @@ A child template might look like this:
270270
271271.. note ::
272272
273- The parent template is identified by a special string syntax
274- (``base.html.twig ``). This path is relative to the ``app/Resources/views ``
275- directory of the project. You could also use the logical name equivalent:
276- ``::base.html.twig ``. This naming convention is explained fully in
277- :ref: `template-naming-locations `.
273+ The parent template is stored in ``app/Resources/views/ ``, so its path is
274+ simply ``base.html.twig ``. The template naming conventions are explained
275+ fully in :ref: `template-naming-locations `.
278276
279277The key to template inheritance is the ``{% extends %} `` tag. This tells
280278the templating engine to first evaluate the base template, which sets up
@@ -382,43 +380,36 @@ to render/extend ``app/Resources/views/base.html.twig``, you'll use the
382380Referencing Templates in a Bundle
383381~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
384382
385- *If * you need to refer to a template that lives in a bundle, Symfony uses a ** bundle **:** directory **:** filename **
386- string syntax. This allows for several types of templates, each which lives in a
387- specific location:
383+ *If * you need to refer to a template that lives in a bundle, Symfony uses the
384+ Twig namespaced syntax (`` @BundleName/directory/filename.html.twig ``). This allows
385+ for several types of templates, each which lives in a specific location:
388386
389- * ``AcmeBlogBundle: Blog: index.html.twig ``: This syntax is used to specify a
387+ * ``@AcmeBlog/ Blog/ index.html.twig ``: This syntax is used to specify a
390388 template for a specific page. The three parts of the string, each separated
391- by a colon (``: ``), mean the following:
389+ by a slash (``/ ``), mean the following:
392390
393- * ``AcmeBlogBundle ``: (* bundle *) the template lives inside the AcmeBlogBundle
394- (e.g. ``src/Acme/BlogBundle ``);
391+ * ``@AcmeBlog ``: is the bundle name without the `` Bundle `` suffix. This template
392+ lives in the AcmeBlogBundle (e.g. ``src/Acme/BlogBundle ``);
395393
396394 * ``Blog ``: (*directory *) indicates that the template lives inside the
397- ``Blog `` subdirectory of ``Resources/views ``;
395+ ``Blog `` subdirectory of ``Resources/views/ ``;
398396
399397 * ``index.html.twig ``: (*filename *) the actual name of the file is
400398 ``index.html.twig ``.
401399
402400 Assuming that the AcmeBlogBundle lives at ``src/Acme/BlogBundle ``, the
403401 final path to the layout would be ``src/Acme/BlogBundle/Resources/views/Blog/index.html.twig ``.
404402
405- * ``AcmeBlogBundle:: layout.html.twig ``: This syntax refers to a base template
403+ * ``@AcmeBlog/ layout.html.twig ``: This syntax refers to a base template
406404 that's specific to the AcmeBlogBundle. Since the middle, "directory", portion
407405 is missing (e.g. ``Blog ``), the template lives at
408- ``Resources/views/layout.html.twig `` inside AcmeBlogBundle. Yes, there are 2
409- colons in the middle of the string when the "controller" subdirectory part is
410- missing.
406+ ``Resources/views/layout.html.twig `` inside AcmeBlogBundle.
411407
412408In the :doc: `/templating/overriding ` section, you'll find out how each
413409template living inside the AcmeBlogBundle, for example, can be overridden
414410by placing a template of the same name in the ``app/Resources/AcmeBlogBundle/views/ ``
415411directory. This gives the power to override templates from any vendor bundle.
416412
417- .. tip ::
418-
419- Hopefully the template naming syntax looks familiar - it's similar to
420- the naming convention used to refer to :ref: `controller-string-syntax `.
421-
422413Template Suffix
423414~~~~~~~~~~~~~~~
424415
0 commit comments