Skip to content

[Cookbook][Templating] New way of creating extensions for twig #2457

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

Merged
merged 1 commit into from
Apr 15, 2013

Conversation

ricardclau
Copy link
Contributor

Q A
Doc fix? yes
New docs? no
Applies to 2.1+
Fixed tickets #2421

Added a note refering to old doc and cookbook for previous versions of Twig and tweaked code to add the Twig filter

.. note::

This cookbook describes how to write a custom Twig extension as of Twig 1.12. If you are using an older version,
please read `Twig extension cookbook legacy`_ and `Twig extensions documentation legacy`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot some linebreaking on the 72th character

@wouterj
Copy link
Member

wouterj commented Apr 3, 2013

While it's not your fault, can you please update some other fixes to this document for me?

  • line 41 - there should be no spaces around the . operator

  • some text is not linebreaked around the 72th character (line 118, 18 and 54)

  • I prefer to have the PHP example at line 86 like this:

    $container
    ->register('acme.twig.acme_extension', 'Acme\DemoBundle\Twig\AcmeExtension');
    ->->addTag('twig.extension')

@ricardclau
Copy link
Contributor Author

Changed (I hope) all your comments!

@wouterj
Copy link
Member

wouterj commented Apr 3, 2013

👍 thank you!

weaverryan added a commit that referenced this pull request Apr 15, 2013
[Cookbook][Templating] New way of creating extensions for twig
@weaverryan weaverryan merged commit f6667bb into symfony:2.1 Apr 15, 2013
@weaverryan
Copy link
Member

Awesome job Ricard - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants