diff --git a/tests/Bridges.Latte/UIMacros.snippet4.phpt b/tests/Bridges.Latte/UIMacros.snippet4.phpt new file mode 100644 index 000000000..deb374f29 --- /dev/null +++ b/tests/Bridges.Latte/UIMacros.snippet4.phpt @@ -0,0 +1,14 @@ +compile(__DIR__ . '/templates/snippets.block.latte') +); diff --git a/tests/Bridges.Latte/expected/UIMacros.snippet4.phtml b/tests/Bridges.Latte/expected/UIMacros.snippet4.phtml new file mode 100644 index 000000000..824781651 --- /dev/null +++ b/tests/Bridges.Latte/expected/UIMacros.snippet4.phtml @@ -0,0 +1,73 @@ +blocks['_snippet'][] = [$this, 'block__snippet_%h%']; + +$_b->blocks['block1'][] = [$this, 'block_block1_%h%']; + +$_b->blocks['_outer'][] = [$this, 'block__outer_%h%']; + +$_b->blocks['block2'][] = [$this, 'block_block2_%h%']; + +// template extending + +$_l->extends = empty($_g->extended) && isset($_control) && $_control instanceof Nette\Application\UI\Presenter ? $_control->findLayoutTemplateFile() : NULL; $_g->extended = TRUE; + +if ($_l->extends) { ob_start(function () {});} + +// main template +if ($_l->extends) { ob_end_clean(); return $this->renderChildTemplate($_l->extends, get_defined_vars()); } +call_user_func(reset($_b->blocks['_snippet']), $_b, $this->params) ?> + + +