From aa975f06c6f303512de6399b7320d48750b96832 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 23 Dec 2019 01:45:28 +0100 Subject: [PATCH] Template: added addFunction() for Latte 2.6 --- src/Bridges/ApplicationLatte/Template.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Bridges/ApplicationLatte/Template.php b/src/Bridges/ApplicationLatte/Template.php index bda6e7d91..f6d1441ce 100644 --- a/src/Bridges/ApplicationLatte/Template.php +++ b/src/Bridges/ApplicationLatte/Template.php @@ -92,6 +92,17 @@ public function addFilter(?string $name, callable $callback) } + /** + * Registers run-time function. + * @return static + */ + public function addFunction(string $name, callable $callback) + { + $this->latte->addFunction($name, $callback); + return $this; + } + + /** * Sets translate adapter. * @return static