Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

javiereguiluz
Copy link
Member

This fixes #7169.

@javiereguiluz javiereguiluz added this to the 3.4 milestone Feb 5, 2018
Creating Lazy-Loaded Twig Extensions
------------------------------------

.. versionadded:: 1.26
Copy link
Member

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.

Copy link
Member Author

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.


class AppRuntime
{
// for complex Twig extensions you may need to define a constructor
Copy link
Member

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.

Copy link
Member Author

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!

javiereguiluz added a commit that referenced this pull request Feb 28, 2018
…iereguiluz)

This PR was squashed before being merged into the 3.4 branch (closes #9204).

Discussion
----------

Documented how to create lazy-loaded Twig extensions

This fixes #7169.

Commits
-------

3173fea Documented how to create lazy-loaded Twig extensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants