From 1a1ba8bba4f1f3ea433aedc3e8d1e360b34351ed Mon Sep 17 00:00:00 2001 From: JakeFr Date: Fri, 13 May 2016 18:05:38 +0200 Subject: [PATCH] [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. --- doc/recipes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/recipes.rst b/doc/recipes.rst index 6627418f1..b035adb8b 100644 --- a/doc/recipes.rst +++ b/doc/recipes.rst @@ -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;