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) ?> + + +
blocks['_outer']), $_b, $this->params) ?> +
$__v) $$__k = $__v; +$_control->redrawControl('snippet', FALSE); + + + } + + + function block_block1_%h%($_b, $_args) + { + unset($_args["this"]); foreach ($_args as $__k => $__v) $$__k = $__v +?>> + static + + $__v) $$__k = $__v; +$_control->redrawControl('outer', FALSE) +?>begin +end +dynSnippets)) return $_l->dynSnippets; + } + + + function block_block2_%h%($_b, $_args) + { + unset($_args["this"]); foreach ($_args as $__k => $__v) $$__k = $__v +?>> + dynamic + + + static + + + +{snippet outer} +begin +
+ dynamic +
+end +{/snippet}