Merge branch 'patch-3' of github.com:ulriklystbaek/handlebars.php

This commit is contained in:
fzerorubigd 2014-08-29 11:08:49 +04:30
commit 77e71e6543

View File

@ -57,15 +57,23 @@ class IfHelper implements Helper
} }
if ($tmp) { if ($tmp) {
$context->push($context->last());
$template->setStopToken('else'); $template->setStopToken('else');
$buffer = $template->render($context); $buffer = $template->render($context);
$template->setStopToken(false); $template->setStopToken(false);
$template->discard($context); $template->discard($context);
$context->pop();
} else { } else {
$context->push($context->last());
$template->setStopToken('else'); $template->setStopToken('else');
$template->discard($context); $template->discard($context);
$template->setStopToken(false); $template->setStopToken(false);
$buffer = $template->render($context); $buffer = $template->render($context);
$context->pop();
} }
return $buffer; return $buffer;