Remvoe obsolete docs

This commit is contained in:
Fabien Potencier
2024-05-14 06:50:45 +01:00
parent 447c9cc17c
commit bf356b3fd7
-16
View File
@@ -93,22 +93,6 @@ to learn more about this topic.
Custom Escapers
---------------
.. versionadded:: 3.10
The ``EscaperRuntime`` class has been added in 3.10. On previous versions,
you can define custom escapers by calling the ``setEscaper()`` method on
the escaper extension instance. The first argument is the escaper strategy
(to be used in the ``escape`` call) and the second one must be a valid PHP
callable::
use Twig\Extension\EscaperExtension;
$twig = new \Twig\Environment($loader);
$twig->getExtension(EscaperExtension::class)->setEscaper('csv', 'csv_escaper');
When called by Twig, the callable receives the Twig environment instance,
the string to escape, and the charset.
You can define custom escapers by calling the ``setEscaper()`` method on the
escaper runtime instance. It accepts two arguments: the strategy name and a PHP
callable that accepts a string to escape and the charset::