File tree 2 files changed +4
-5
lines changed
Filter options
2 files changed +4
-5
lines changed
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ Twig Extension & Autoconfiguration
158
158
159
159
Thanks to Symfony's service handling, you can *extend * Symfony in many ways, like
160
160
by creating an event subscriber or a security voter for complex authorization
161
- rules. Let's add a new filter to Twig called ``greet ``. How? Create a simple class
161
+ rules. Let's add a new filter to Twig called ``greet ``. How? Create a class
162
162
with your logic::
163
163
164
164
// src/Twig/GreetExtension.php
Original file line number Diff line number Diff line change @@ -1602,7 +1602,7 @@ If you want to create a function instead of a filter, use the
1602
1602
1603
1603
.. versionadded :: 7.3
1604
1604
1605
- Support for the ``#[AsTwigFilter] `` and ``#[AsTwigFunction ] `` attributes was introduced in Symfony 7.3.
1605
+ Support for the ``#[AsTwigFilter] ``, `` #[AsTwigFunction] `` and ``#[AsTwigTest ] `` attributes was introduced in Symfony 7.3.
1606
1606
Previously, you had to extend the ``AbstractExtension `` class, and override the
1607
1607
``getFilters() `` and ``getFunctions() `` methods.
1608
1608
@@ -1635,9 +1635,8 @@ Creating Lazy-Loaded Twig Extensions
1635
1635
1636
1636
When using attributes to extend Twig, the services are initialized only when
1637
1637
the functions or filters are used to render the template. But in case you use the
1638
- classic approach by extending the ``AbstractExtension `` class, Twig initialize all extensions before
1639
- rendering rendering any template, even if the template doesn't use an
1640
- extension.
1638
+ classic approach by extending the ``AbstractExtension `` class, Twig initializes all the extensions before
1639
+ rendering any template, even if the extension is not used in the template.
1641
1640
1642
1641
If extensions don't define dependencies (i.e. if you don't inject services in
1643
1642
them) performance is not affected. However, if extensions define lots of complex
You can’t perform that action at this time.
0 commit comments