mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
[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:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user