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:
ulriklystbaek 2014-08-28 09:50:53 +02:00
parent c6f3e0fd5e
commit abb88322e0

View File

@ -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;
}