Changed the internal 'if' helper such that it can test not only paths/variable names, but also numeric constants.

This will be helpful for subexpressions later, when testing numeric subexpressions return values,

eg: {{#if (eq 0 (mod @index 3))}}

Also added a test for this.
This commit is contained in:
majortom731 2014-03-12 17:00:09 +01:00
parent d7a9844e93
commit 5c3ea257b7

View File

@ -88,7 +88,11 @@ class Helpers
* @var $args array
* @var $source string
*/
$tmp = $context->get($args);
if( is_numeric($args) ) {
$tmp = $args;
} else {
$tmp = $context->get($args);
}
if ($tmp) {
$template->setStopToken('else');