mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-04-09 00:30:11 +03:00
Merge branch 'patch-3' of github.com:ulriklystbaek/handlebars.php
This commit is contained in:
commit
77e71e6543
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user