Skip to content

Commit d26a323

Browse files
committed
[TwigBundle] Allow omitting the autoescape_service_method
1 parent 7c239dc commit d26a323

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

reference/configuration/twig.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ autoescape_service_method
8585
If ``autoescape_service`` option is defined, then this option defines the method
8686
called to determine the default escaping applied to the template.
8787

88+
If the service defined in ``autoescape_service`` in invocable (i.e. it defines
89+
the `__invoke() PHP magic method`_) you can omit this option.
90+
91+
.. versionadded:: 6.4
92+
93+
The feature to use invocable services to omit this option was introduced in
94+
Symfony 6.4.
95+
8896
base_template_class
8997
~~~~~~~~~~~~~~~~~~~
9098

@@ -434,3 +442,4 @@ and the non-existing values are replaced by ``null``.
434442

435443
.. _`the optimizer extension`: https://twig.symfony.com/doc/3.x/api.html#optimizer-extension
436444
.. _`XSS attacks`: https://en.wikipedia.org/wiki/Cross-site_scripting
445+
.. _`__invoke() PHP magic method`: https://www.php.net/manual/en/language.oop5.magic.php#object.invoke

0 commit comments

Comments
 (0)