Closed
Description
Description
Maybe I misunderstood some things about TwigRuntime but when I create one I have to do:
- One runtime, with some services injections and a method
doThings
. - One twigExtension with the code:
new TwigFunction('doThings', [MyRuntime::class, 'doThings']),
This create duplicate classes.
Eventually, one thing I can do is to have multiple runtimes, but one single twigExtension calling all of them.
new TwigFunction('doThings', [MyRuntime::class, 'doThings']),
new TwigFunction('doOtherThings', [MyOtherRuntime::class, 'doOtherThings']),
But I was wondering the purpose of this twigExtension in such case and if this couldn't be generated by some config directly:
framework:
twig:
functions:
filters:
tests:
What do you think about such feature ?