We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I am migrating a code base from Twig 1.x to 2.x.
Macros where loaded globally with a custom extension like this :
public function initRuntime(Twig_Environment $environment) { $environment->addGlobal('...', $environment->loadTemplate('...')); }
Running this in 2.x throws an exception: Unable to add global "..." as the runtime or the extensions have already been initialized
Unable to add global "..." as the runtime or the extensions have already been initialized
I cannot find a way to do this in 2.x reading the docs.
Is it still supported? If yes, what is the proper way to do this?
Thanks, Nicolas
The text was updated successfully, but these errors were encountered:
Closing as this is not supported anymore at runtime. But they can still be registered in the extension itself.
Sorry, something went wrong.
No branches or pull requests
Hello,
I am migrating a code base from Twig 1.x to 2.x.
Macros where loaded globally with a custom extension like this :
Running this in 2.x throws an exception:
Unable to add global "..." as the runtime or the extensions have already been initialized
I cannot find a way to do this in 2.x reading the docs.
Is it still supported? If yes, what is the proper way to do this?
Thanks,
Nicolas
The text was updated successfully, but these errors were encountered: