mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +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);
|
||||
|
||||
$context->push($context->last());
|
||||
|
||||
if (!$tmp) {
|
||||
$template->setStopToken('else');
|
||||
$buffer = $template->render($context);
|
||||
@ -62,6 +64,8 @@ class UnlessHelper implements Helper
|
||||
$template->setStopToken(false);
|
||||
$buffer = $template->render($context);
|
||||
}
|
||||
|
||||
$context->pop();
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user