mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-03 10:33:08 +03:00
Update UnlessHelper.php
To comply with handlebars.js, If adds an extra layer when need to access parents (https://github.com/wycats/handlebars.js/issues/196)
This commit is contained in:
parent
c6f3e0fd5e
commit
abb88322e0
@ -52,6 +52,8 @@ class UnlessHelper implements Helper
|
|||||||
{
|
{
|
||||||
$tmp = $context->get($args);
|
$tmp = $context->get($args);
|
||||||
|
|
||||||
|
$context->push($context->last());
|
||||||
|
|
||||||
if (!$tmp) {
|
if (!$tmp) {
|
||||||
$template->setStopToken('else');
|
$template->setStopToken('else');
|
||||||
$buffer = $template->render($context);
|
$buffer = $template->render($context);
|
||||||
@ -63,6 +65,8 @@ class UnlessHelper implements Helper
|
|||||||
$buffer = $template->render($context);
|
$buffer = $template->render($context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$context->pop();
|
||||||
|
|
||||||
return $buffer;
|
return $buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user