File tree 1 file changed +33
-5
lines changed
1 file changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,40 @@ If your templates are not stored in the default ``app/Resources/views/``
91
91
directory, use the :ref: `twig.paths <config-twig-paths >` configuration option to
92
92
define your own templates directory (or directories):
93
93
94
- .. code -block :: yaml
94
+ .. configuration -block ::
95
95
96
- # app/config/config.yml
97
- twig :
98
- # ...
99
- paths : ["%kernel.root_dir%/../templates"]
96
+ .. code-block :: yaml
97
+
98
+ # app/config/config.yml
99
+ twig :
100
+ # ...
101
+ paths : ["%kernel.root_dir%/../templates"]
102
+
103
+ .. code-block :: xml
104
+
105
+ <!-- app/config/config.xml -->
106
+ <?xml version =" 1.0" ?>
107
+ <container xmlns =" http://symfony.com/schema/dic/services"
108
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
109
+ xmlns : twig =" http://symfony.com/schema/dic/twig"
110
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
111
+ http://symfony.com/schema/dic/services/services-1.0.xsd
112
+ http://symfony.com/schema/dic/twig
113
+ http://symfony.com/schema/dic/twig/twig-1.0.xsd" >
114
+
115
+ <twig : config >
116
+ <twig : path >%kernel.root_dir%/../templates</twig : path >
117
+ </twig : config >
118
+ </container >
119
+
120
+ .. code-block :: php
121
+
122
+ // app/config/config.php
123
+ $container->loadFromExtension('twig', array(
124
+ 'paths' => array(
125
+ '%kernel.root_dir%/../templates',
126
+ ),
127
+ ));
100
128
101
129
.. _override-web-dir :
102
130
You can’t perform that action at this time.
0 commit comments