mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
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:
parent
d7a9844e93
commit
5c3ea257b7
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user