diff --git a/book/templating.rst b/book/templating.rst index 62500e250bb..05c607eb4a8 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -584,9 +584,9 @@ you set `with_context`_ to false). maps (i.e. an array with named keys). If you needed to pass in multiple elements, it would look like this: ``{'foo': foo, 'bar': bar}``. -.. versionadded:: 2.2 +.. versionadded:: 2.3 The `include() function`_ is a new Twig feature that's available in Symfony - 2.2. Prior, the `{% include %} tag`_ tag was used. + 2.3. Prior, the `{% include %} tag`_ tag was used. .. index:: single: Templating; Embedding action diff --git a/cookbook/profiler/data_collector.rst b/cookbook/profiler/data_collector.rst index 985738aa5cb..74e7d07006a 100644 --- a/cookbook/profiler/data_collector.rst +++ b/cookbook/profiler/data_collector.rst @@ -131,15 +131,15 @@ following example can help you get started: {% endset %} - {# Set the "link" value to false if you do not have a big "panel" + {# Set the "link" value to false if you do not have a big "panel" section that you want to direct the user to. #} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': true } %} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }} {% endblock %} {% block head %} - {# Optional, if you need your own JS or CSS files. #} - {{ parent() }} {# Use parent() to keep the default styles #} + {# Optional, if you need your own JS or CSS files. #} + {{ parent() }} {# Use parent() to keep the default styles #} {% endblock %} {% block menu %} @@ -151,7 +151,7 @@ following example can help you get started: {% endblock %} {% block panel %} - {# Optional, for showing the most details. #} + {# Optional, for showing the most details. #}
Major information goes here diff --git a/cookbook/templating/namespaced_paths.rst b/cookbook/templating/namespaced_paths.rst index 3cccde0bf10..94c37f67fb4 100644 --- a/cookbook/templating/namespaced_paths.rst +++ b/cookbook/templating/namespaced_paths.rst @@ -18,14 +18,14 @@ Take the following paths as an example: .. code-block:: jinja {% extends "AppBundle::layout.html.twig" %} - {% include "AppBundle:Foo:bar.html.twig" %} + {{ include('AppBundle:Foo:bar.html.twig') }} With namespaced paths, the following works as well: .. code-block:: jinja {% extends "@App/layout.html.twig" %} - {% include "@App/Foo/bar.html.twig" %} + {{ include('@App/Foo/bar.html.twig') }} Both paths are valid and functional by default in Symfony. @@ -80,7 +80,7 @@ called ``sidebar.twig`` in that directory, you can use it easily: .. code-block:: jinja - {% include '@foo_bar/sidebar.twig' %} + {{ include('@foo_bar/sidebar.twig') }} Multiple Paths per Namespace ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -134,4 +134,4 @@ in the previous three directories: .. code-block:: jinja - {% include '@theme/header.twig' %} + {{ include('@theme/header.twig') }}