From b641623f054ceeb46d531c08dfd5a6db5fd2ff4f Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Sun, 27 Sep 2015 20:57:56 +0200 Subject: [PATCH] add asInt filter for web templates --- www/inc/rendering/twig_extensions.php | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/www/inc/rendering/twig_extensions.php b/www/inc/rendering/twig_extensions.php index ab32224..8cc1c3d 100644 --- a/www/inc/rendering/twig_extensions.php +++ b/www/inc/rendering/twig_extensions.php @@ -58,6 +58,7 @@ class SmokeFilterExtension extends Twig_Extension 'isFalse' => new Twig_Filter_Method($this, 'isFalse'), 'isNull' => new Twig_Filter_Method($this, 'isFalse'), 'getClass' => new Twig_Filter_Method($this, 'getClass'), + 'asInt' => new Twig_Filter_Method($this, 'asInt'), ); } @@ -74,6 +75,7 @@ class SmokeFilterExtension extends Twig_Extension else return "basic:".gettype($o); } + public function asInt($v){return $v+0;} public function getName() { -- 1.7.2.5