mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-04 22:47:21 +00:00
Update advanced.rst
Hello,
I just updated the class name 😉
This commit is contained in:
committed by
Fabien Potencier
parent
10319b4f6a
commit
e030bf6e38
+2
-2
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user