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
da443c5fd5
commit
d7a9844e93
@ -248,6 +248,16 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
||||
'{{#bindAttr data}}',
|
||||
array(),
|
||||
'data'
|
||||
),
|
||||
array(
|
||||
'{{#if 1}}ok{{else}}fail{{/if}}',
|
||||
array(),
|
||||
'ok'
|
||||
),
|
||||
array(
|
||||
'{{#if 0}}ok{{else}}fail{{/if}}',
|
||||
array(),
|
||||
'fail'
|
||||
)
|
||||
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user