Reputation: 3
I need to access a global defined with php function define(MY_GLOBAL, 'foo'); in a twig template. I can't use the detour $app['twiq']->addGlobal(); because I'm in my config file
Any ideas ?
Upvotes: 0
Views: 1116
Reputation: 522005
That's not a global, that's a constant. For accessing constants, there's the aptly named constant()
:
{{ constant('MY_GLOBAL') }}
Upvotes: 4