projects
/
web/konrad/smoke.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
c72f845
)
add asInt filter for web templates
author
Konrad Rosenbaum
<konrad@silmor.de>
Sun, 27 Sep 2015 18:57:56 +0000 (20:57 +0200)
committer
Konrad Rosenbaum
<konrad@silmor.de>
Sun, 27 Sep 2015 18:57:56 +0000 (20:57 +0200)
www/inc/rendering/twig_extensions.php
patch
|
blob
|
history
diff --git
a/www/inc/rendering/twig_extensions.php
b/www/inc/rendering/twig_extensions.php
index
ab32224
..
8cc1c3d
100644
(file)
--- 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()
{