File tree Expand file tree Collapse file tree 1 file changed +33
-5
lines changed Expand file tree Collapse file tree 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/``
9191directory, use the :ref: `twig.paths <config-twig-paths >` configuration option to
9292define your own templates directory (or directories):
9393
94- .. code -block :: yaml
94+ .. configuration -block ::
9595
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+ ));
100128
101129 .. _override-web-dir :
102130
You can’t perform that action at this time.
0 commit comments