Skip to content

Replace overriding twig.paths by twig.default_path #14135

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 1 commit into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
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
12 changes: 5 additions & 7 deletions configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Override the Templates Directory
--------------------------------

If your templates are not stored in the default ``app/Resources/views/``
directory, use the :ref:`twig.paths <config-twig-paths>` configuration option to
define your own templates directory (or directories):
directory, use the :ref:`twig.default_path <config-twig-default-path>` configuration option to
define your own templates directory (use :ref:`twig.paths <config-twig-paths>` for multiple directories):

.. configuration-block::

Expand All @@ -104,7 +104,7 @@ define your own templates directory (or directories):
# app/config/config.yml
twig:
# ...
paths: ["%kernel.project_dir%/templates"]
default_path: "%kernel.project_dir%/templates"

.. code-block:: xml

Expand All @@ -119,7 +119,7 @@ define your own templates directory (or directories):
https://symfony.com/schema/dic/twig/twig-1.0.xsd">

<twig:config>
<twig:path>%kernel.project_dir%/templates</twig:path>
<twig:default-path>%kernel.project_dir%/templates</twig:default-path>
</twig:config>

</container>
Expand All @@ -128,9 +128,7 @@ define your own templates directory (or directories):

// app/config/config.php
$container->loadFromExtension('twig', [
'paths' => [
'%kernel.project_dir%/templates',
],
'default_path' => '%kernel.project_dir%/templates',
]);

.. _override-web-dir:
Expand Down
2 changes: 2 additions & 0 deletions reference/configuration/twig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ on. Set it to ``0`` to disable all the optimizations. You can even enable or
disable these optimizations selectively, as explained in the Twig documentation
about `the optimizer extension`_.

.. _config-twig-default-path:

``default_path``
~~~~~~~~~~~~~~~~

Expand Down