File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1556,7 +1556,7 @@ as currency:
15561556 .. _templates-twig-filter-attribute :
15571557
15581558Create 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
15601560the 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+
16091613Register an Extension as a Service
16101614..................................
16111615
You can’t perform that action at this time.
0 commit comments