@@ -122,22 +122,15 @@ public function load(array $configs, ContainerBuilder $container)
CFB1
div>
122
122
foreach ($ bundle ['paths ' ] as $ path ) {
123
123
$ twigFilesystemLoaderDefinition ->addMethodCall ('addPath ' , array ($ path , $ namespace ));
124
124
}
125
- }
126
125
127
- if ($ container ->fileExists ($ dir = $ container ->getParameter ('kernel.root_dir ' ).'/Resources/views ' , false )) {
128
- $ twigFilesystemLoaderDefinition ->addMethodCall ('addPath ' , array ($ dir ));
126
+ $ twigFilesystemLoaderDefinition ->addMethodCall ('addPath ' , array ($ config ['default_path ' ].'/bundles/ ' .$ namespace , $ namespace ));
129
127
}
130
128
131
- if ($ container ->fileExists ($ dir = $ container ->getParameter ('kernel.project_dir ' ).'/templates ' , false )) {
129
+ if ($ container ->fileExists ($ dir = $ container ->getParameter ('kernel.root_dir ' ).'/Resources/views ' , false )) {
132
130
$ twigFilesystemLoaderDefinition ->addMethodCall ('addPath ' , array ($ dir ));
133
131
}
134
132
135
- if ($ container ->fileExists ($ dir = $ container ->getParameter ('kernel.project_dir ' ).'/templates/bundles ' , false )) {
136
- foreach (glob ($ dir .'/* ' , GLOB_ONLYDIR ) as $ path ) {
137
- $ parts = explode (DIRECTORY_SEPARATOR , $ path );
138
- $ twigFilesystemLoaderDefinition ->addMethodCall ('addPath ' , array ($ path , end ($ parts )));
139
- }
140
- }
133
+ $ twigFilesystemLoaderDefinition ->addMethodCall ('addPath ' , array ($ config ['default_path ' ]));
141
134
142
135
if (!empty ($ config ['globals ' ])) {
143
136
$ def = $ container ->getDefinition ('twig ' );
0 commit comments