-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Documented how to create lazy-loaded Twig extensions #9204
New issue
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
Conversation
Creating Lazy-Loaded Twig Extensions | ||
------------------------------------ | ||
|
||
.. versionadded:: 1.26 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we refer to Symfony versions here? Having a Twig version seems weird to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's not very common, but we add those version numbers for Twig and other apps different than Symfony in some places of the docs.
templating/twig_extension.rst
Outdated
|
||
class AppRuntime | ||
{ | ||
// for complex Twig extensions you may need to define a constructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would even say that if you don't have dependencies, you should never create a runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I've reworded some things. Thanks!
This fixes #7169.