diff --git a/composer.json b/composer.json index b64b3d6d7..583d342a5 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "nette/di": "~2.3", "nette/forms": "~2.2", "nette/robot-loader": "~2.2", - "latte/latte": "~2.3.0" + "latte/latte": "~2.3.9" }, "conflict": { "nette/nette": "<2.2" diff --git a/tests/Bridges.Latte/UIMacros.renderSnippets3.phpt b/tests/Bridges.Latte/UIMacros.renderSnippets3.phpt new file mode 100644 index 000000000..5447ec7a8 --- /dev/null +++ b/tests/Bridges.Latte/UIMacros.renderSnippets3.phpt @@ -0,0 +1,37 @@ +getCompiler()); + $params['_control'] = $this; + $latte->setTempDirectory(__DIR__ . '/../tmp/'); + $latte->render(__DIR__ . '/templates/snippetArea-include.latte', $params); + } +} + + +$presenter = new TestPresenter; +$presenter->snippetMode = TRUE; +$presenter->redrawControl('foo'); +$presenter->redrawControl('data'); +$presenter->render(); +Assert::same(array( + 'snippets' => array( + 'snippet--bar-1' => "1\n", + 'snippet--bar-2' => "2\n", + ), +), (array) $presenter->payload); diff --git a/tests/Bridges.Latte/templates/snippetArea-include.latte b/tests/Bridges.Latte/templates/snippetArea-include.latte new file mode 100644 index 000000000..7459083b2 --- /dev/null +++ b/tests/Bridges.Latte/templates/snippetArea-include.latte @@ -0,0 +1,5 @@ +{snippetArea foo} + {foreach [1, 2] as $id} + {snippet bar-$id}{include 'snippetArea-included.latte' id => $id}{/snippet} + {/foreach} +{/snippetArea} diff --git a/tests/Bridges.Latte/templates/snippetArea-included.latte b/tests/Bridges.Latte/templates/snippetArea-included.latte new file mode 100644 index 000000000..e3336d3cd --- /dev/null +++ b/tests/Bridges.Latte/templates/snippetArea-included.latte @@ -0,0 +1 @@ +{$id}