Skip to content

Commit b6e4367

Browse files
resolve last conversation and fix CI
1 parent 7272da2 commit b6e4367

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

templates.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ as currency:
15561556
.. _templates-twig-filter-attribute:
15571557

15581558
Create a class with a method that contains the filter logic, then add
1559-
the `#[AsTwigFilter]` attribute to define the name and options of
1559+
the ``#[AsTwigFilter]`` attribute to define the name and options of
15601560
the Twig filter::
15611561

15621562
// src/Twig/AppExtension.php
@@ -1603,9 +1603,13 @@ If you want to create a function instead of a filter, use the
16031603
.. versionadded:: 7.3
16041604

16051605
Support for the ``#[AsTwigFilter]`` and ``#[AsTwigFunction]`` attributes was introduced in Symfony 7.3.
1606-
Previously, you had to extend the `AbstractExtension` class, and override the
1606+
Previously, you had to extend the ``AbstractExtension`` class, and override the
16071607
``getFilters()`` and ``getFunctions()`` methods.
16081608

1609+
When using autoconfiguration, the tag ``twig.attribute_extension`` is added automatically
1610+
when a Twig attribute is used on a method of a class. Otherwise, when autoconfiguration is not enabled,
1611+
it needs to be added in the service definition.
1612+
16091613
Register an Extension as a Service
16101614
..................................
16111615

0 commit comments

Comments
 (0)