From: Konrad Rosenbaum Date: Sun, 27 Sep 2015 18:57:56 +0000 (+0200) Subject: add asInt filter for web templates X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=b641623f054ceeb46d531c08dfd5a6db5fd2ff4f;p=web%2Fkonrad%2Fsmoke.git add asInt filter for web templates --- 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() {