Skip to content

Commit c3b9b2b

Browse files
committed
Replace overriding twig.paths by twig.default_path
1 parent 6f27e88 commit c3b9b2b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

configuration/override_dir_structure.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ Override the Templates Directory
9494
--------------------------------
9595

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

100100
.. configuration-block::
101101

@@ -104,7 +104,7 @@ define your own templates directory (or directories):
104104
# app/config/config.yml
105105
twig:
106106
# ...
107-
paths: ["%kernel.project_dir%/templates"]
107+
default_path: "%kernel.project_dir%/templates"
108108
109109
.. code-block:: xml
110110
@@ -119,7 +119,7 @@ define your own templates directory (or directories):
119119
https://symfony.com/schema/dic/twig/twig-1.0.xsd">
120120
121121
<twig:config>
122-
<twig:path>%kernel.project_dir%/templates</twig:path>
122+
<twig:default-path>%kernel.project_dir%/templates</twig:default-path>
123123
</twig:config>
124124
125125
</container>
@@ -128,9 +128,7 @@ define your own templates directory (or directories):
128128
129129
// app/config/config.php
130130
$container->loadFromExtension('twig', [
131-
'paths' => [
132-
'%kernel.project_dir%/templates',
133-
],
131+
'default_path' => '%kernel.project_dir%/templates',
134132
]);
135133
136134
.. _override-web-dir:

reference/configuration/twig.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ on. Set it to ``0`` to disable all the optimizations. You can even enable or
243243
disable these optimizations selectively, as explained in the Twig documentation
244244
about `the optimizer extension`_.
245245

246+
.. _config-twig-default-path:
247+
246248
``default_path``
247249
~~~~~~~~~~~~~~~~
248250

0 commit comments

Comments
 (0)