[DOC] recipes.rst uses Twig_Function_Function

Hello,
Here's a minor update for recipes.rst
I rewrite the code sample for registerUndefinedFunctionCallback to remove usage of deprecated class Twig_Function_Function.
This commit is contained in:
JakeFr
2016-05-13 18:05:38 +02:00
parent f167cc0a65
commit 1a1ba8bba4
+1 -1
View File
@@ -280,7 +280,7 @@ For functions, use ``registerUndefinedFunctionCallback()``::
// don't try this at home as it's not secure at all!
$twig->registerUndefinedFunctionCallback(function ($name) {
if (function_exists($name)) {
return new Twig_Function_Function($name);
return new Twig_SimpleFunction($name, $name);
}
return false;