Skip to content

Commit

Permalink
Remvoe obsolete docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed May 14, 2024
1 parent 447c9cc commit bf356b3
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions doc/filters/escape.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down

0 comments on commit bf356b3

Please sign in to comment.