mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 20:16:45 +00:00
fixed nested embed tag calls
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
* 1.8.4 (2012-XX-XX)
|
||||
|
||||
* n/a
|
||||
* fixed nested embed tag calls
|
||||
|
||||
* 1.8.3 (2012-06-17)
|
||||
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ class Twig_Parser implements Twig_ParserInterface
|
||||
|
||||
public function embedTemplate(Twig_Node_Module $template)
|
||||
{
|
||||
$template->setIndex(count($this->embeddedTemplates) + 1);
|
||||
$template->setIndex(mt_rand());
|
||||
|
||||
$this->embeddedTemplates[] = $template;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
"embed" tag
|
||||
--TEMPLATE--
|
||||
{% embed "foo.twig" %}
|
||||
{% block c1 %}
|
||||
{{ parent() }}
|
||||
{% embed "foo.twig" %}
|
||||
{% block c1 %}
|
||||
{{ parent() }}
|
||||
block1extended
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
--TEMPLATE(foo.twig)--
|
||||
A
|
||||
{% block c1 %}
|
||||
block1
|
||||
{% endblock %}
|
||||
B
|
||||
{% block c2 %}
|
||||
block2
|
||||
{% endblock %}
|
||||
C
|
||||
--DATA--
|
||||
return array()
|
||||
--EXPECT--
|
||||
A
|
||||
block1
|
||||
|
||||
|
||||
A
|
||||
block1
|
||||
|
||||
block1extended
|
||||
B
|
||||
block2
|
||||
C
|
||||
B
|
||||
block2
|
||||
C
|
||||
Reference in New Issue
Block a user