File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ public function render($template, $parameters = [])
103
103
$ this ->engine ->addFunction ($ this ->getArgumentsFromRoute ());
104
104
$ this ->engine ->addFunction ($ this ->getServicesClassInitialization ());
105
105
$ this ->engine ->addFunction ($ this ->getServicesClassInjection ());
106
+ $ this ->engine ->addFunction ($ this ->getServicesClassInjectionNoOverride ());
106
107
$ this ->engine ->addFunction ($ this ->getTagsAsArray ());
107
108
$ this ->engine ->addFunction ($ this ->getTranslationAsYamlComment ());
108
109
$ this ->engine ->addFilter ($ this ->createMachineName ());
@@ -210,6 +211,25 @@ public function getServicesClassInjection()
210
211
return $ returnValue ;
211
212
}
212
213
214
+ /**
215
+ * @return \Twig_SimpleFunction
216
+ */
217
+ public function getServicesClassInjectionNoOverride ()
218
+ {
219
+ $ returnValue = new \Twig_SimpleFunction (
220
+ 'serviceClassInjectionNoOverride ' , function ($ services ) {
221
+ $ returnValues = [];
222
+ foreach ($ services as $ service ) {
223
+ $ returnValues [] = sprintf (' $instance->%s = $container->get( \'%s \'); ' , $ service ['camel_case_name ' ], $ service ['name ' ]);
224
+ }
225
+
226
+ return implode (PHP_EOL , $ returnValues );
227
+ }
228
+ );
229
+
230
+ return $ returnValue ;
231
+ }
232
+
213
233
/**
214
234
* @return \Twig_SimpleFunction
215
235
*/
You can’t perform that action at this time.
0 commit comments