Skip to content

[Twig] [TwigBundle] Allow omitting the autoescape_service_method #18575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2023
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
9 changes: 9 additions & 0 deletions reference/configuration/twig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ autoescape_service_method
If ``autoescape_service`` option is defined, then this option defines the method
called to determine the default escaping applied to the template.

If the service defined in ``autoescape_service`` in invocable (i.e. it defines
the `__invoke() PHP magic method`_) you can omit this option.

.. versionadded:: 6.4

The feature to use invocable services to omit this option was introduced in
Symfony 6.4.

base_template_class
~~~~~~~~~~~~~~~~~~~

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

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