@@ -98,8 +98,9 @@ Override the Templates Directory
98
98
--------------------------------
99
99
100
100
If your templates are not stored in the default ``templates/ `` directory, use
101
- the :ref: `twig.paths <config-twig-paths >` configuration option to define your
102
- own templates directory (or directories):
101
+ the :ref: `twig.default_path <config-twig-default-path >` configuration
102
+ option to define your own templates directory (use :ref: `twig.paths <config-twig-paths >`
103
+ for multiple directories):
103
104
104
105
.. configuration-block ::
105
106
@@ -108,7 +109,7 @@ own templates directory (or directories):
108
109
# config/packages/twig.yaml
109
110
twig :
110
111
# ...
111
- paths : [ "%kernel.project_dir%/resources/views"]
112
+ default_path : " %kernel.project_dir%// resources/views"
112
113
113
114
.. code-block :: xml
114
115
@@ -123,7 +124,7 @@ own templates directory (or directories):
123
124
https://symfony.com/schema/dic/twig/twig-1.0.xsd" >
124
125
125
126
<twig : config >
126
- <twig : path >%kernel.project_dir%/resources/views</twig : path >
127
+ <twig : default- path >%kernel.project_dir%/resources/views</twig : default- path >
127
128
</twig : config >
128
129
129
130
</container >
@@ -132,9 +133,7 @@ own templates directory (or directories):
132
133
133
134
// config/packages/twig.php
134
135
$container->loadFromExtension('twig', [
135
- 'paths' => [
136
- '%kernel.project_dir%/resources/views',
137
- ],
136
+ 'default_path' => '%kernel.project_dir%/resources/views',
138
137
]);
139
138
140
139
Override the Translations Directory
0 commit comments