Add more information about migrating away from twig_escape_filter()

This commit is contained in:
Fabien Potencier
2024-04-29 08:09:07 +02:00
parent 70b2e3ca5d
commit d728d1b8a6
2 changed files with 20 additions and 1 deletions
+6 -1
View File
@@ -1,6 +1,11 @@
# 3.10.0 (2024-XX-XX)
* Extract the escaping logic to a runtime
* Extract the escaping logic from the `EscapingExtension` class to a new `EscapingRuntime` class.
The following methods from ``Twig\\Extension\\EscaperExtension`` are
deprecated: ``setEscaper()``, ``getEscapers()``, ``setDefaultStrategy()``,
``getDefaultStrategy()``, ``setSafeClasses``, ``addSafeClasses()``. Use the
same methods on the ``Twig\\Runtime\\EscaperRuntime`` class instead.
# 3.9.3 (2024-04-18)
+14
View File
@@ -18,6 +18,20 @@ Extensions
3.9.0, and will be removed in Twig 4.0. They have been replaced by internal
methods on their respective extension classes.
If you were using the ``twig_escape_filter()`` function is your code, use
``$env->getRuntime(EscaperRuntime::class)->escape()`` instead.
* The following methods from ``Twig\Extension\EscaperExtension`` are
deprecated: ``setEscaper()``, ``getEscapers()``, ``setDefaultStrategy()``,
``getDefaultStrategy()``, ``setSafeClasses``, ``addSafeClasses()``. Use the
same methods on the ``Twig\Runtime\EscaperRuntime`` class instead.
Before:
$twig->getExtension(EscaperExtension::class)->METHOD()
After:
$twig->getRuntime(EscaperRuntime::class)->METHOD();
Node Visitors
-------------