Update advanced.rst

Hello,

I just updated the class name 😉
This commit is contained in:
Abdouni Abdelkarim
2020-02-12 23:46:38 +01:00
committed by Fabien Potencier
parent 10319b4f6a
commit e030bf6e38
+2 -2
View File
@@ -189,7 +189,7 @@ If you want to access the current environment instance in your filter, set the
``needs_environment`` option to ``true``; Twig will pass the current
environment as the first argument to the filter call::
$filter = new \Twig\TwigFilter('rot13', function (Twig_Environment $env, $string) {
$filter = new \Twig\TwigFilter('rot13', function (\Twig\Environment $env, $string) {
// get the current charset for instance
$charset = $env->getCharset();
@@ -208,7 +208,7 @@ the first argument to the filter call (or the second one if
// ...
}, ['needs_context' => true]);
$filter = new \Twig\TwigFilter('rot13', function (Twig_Environment $env, $context, $string) {
$filter = new \Twig\TwigFilter('rot13', function (\Twig\Environment $env, $context, $string) {
// ...
}, ['needs_context' => true, 'needs_environment' => true]);