mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
Update Template.php
Update Template.php added test case
This commit is contained in:
parent
86a388058f
commit
666e44beb5
@ -581,6 +581,9 @@ class Template
|
||||
{
|
||||
$name = $current[Tokenizer::NAME];
|
||||
$value = $context->get($name);
|
||||
if (is_array($value)) {
|
||||
return 'Array';
|
||||
}
|
||||
if ($escaped) {
|
||||
$args = $this->handlebars->getEscapeArgs();
|
||||
array_unshift($args, $value);
|
||||
|
@ -711,6 +711,8 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('var-y-z', $engine->render('{{var.y.z}}', array('var' => $var)));
|
||||
// Access parent context in with helper
|
||||
$this->assertEquals('var-x', $engine->render('{{#with var.y}}{{../var.x}}{{/with}}', array('var' => $var)));
|
||||
// Reference array as string
|
||||
$this->assertEquals('Array', $engine->render('{{var}}', array('var' => array('test'))));
|
||||
|
||||
$obj = new DateTime();
|
||||
$time = $obj->getTimestamp();
|
||||
|
Loading…
Reference in New Issue
Block a user