Le 29/10/2011 17:06, FractalizeR a écrit :
2Christophe COEVOET :
Can you please be a little bit more specific? How to do that?
I was trying to get Twig service instance from my extension like this:
public function load(array $configs, ContainerBuilder
$container) {
$container->getDefinition('twig');
}
But it seems, I got it wrong, because definitions array is empty
inside load() method. How can I add more global variables from my
extension to Twig?
I said you can add globals from a *Twig* extension, not from a *DI*
extension. The /Twig_ExtensionInterface/ has a /getGlobals/ method
allowing to set some global variables:
http://twig.sensiolabs.org/doc/extensions.html
--
Christophe | Stof
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en