Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1071,12 +1071,13 @@ the service is auto-registered and auto-tagged. But, you can also register it ma
$container
->register(AppExtension::class)
->addTag('twig.extension')

;
$container
Copy link
Member Author

Choose a reason for hiding this comment

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

addTag() returns the Definition instance itself, but we need the ContainerBuilder to call register()

->register(AnotherExtension::class)
->addTag('twig.extension', array('priority' => -100))
;

.. versionadded::
.. versionadded:: 4.1
Copy link
Member Author

Choose a reason for hiding this comment

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

the version number is needed for the versionadded block to be rendered correctly

The ``priority`` attribute of the ``twig.extension`` tag was introduced in
Symfony 4.1.

Expand Down