Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #2124 fixed embed parent token for simple use cases (fabpot)
This PR was merged into the 1.x branch. Discussion ---------- fixed embed parent token for simple use cases Not the most elegant solution but solves the problem for when `embed` is used on a non-dynamic template, which should cover almost all use cases. Commits ------- a048985 fixed embed parent token for simple use cases a9082dd fixed typo
- Loading branch information
Showing
4 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--TEST-- | ||
"embed" tag | ||
--TEMPLATE-- | ||
FOO | ||
{% embed foo ~ ".twig" %} | ||
{% block c1 %} | ||
{{ parent() }} | ||
block1extended | ||
{% endblock %} | ||
{% endembed %} | ||
|
||
BAR | ||
--TEMPLATE(foo.twig)-- | ||
A | ||
{% block c1 %} | ||
block1 | ||
{% endblock %} | ||
B | ||
{% block c2 %} | ||
block2 | ||
{% endblock %} | ||
C | ||
--DATA-- | ||
return array('foo' => 'foo') | ||
--EXPECT-- | ||
FOO | ||
|
||
A | ||
block1 | ||
|
||
block1extended | ||
B | ||
block2 | ||
C | ||
BAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--TEST-- | ||
"embed" tag | ||
--TEMPLATE-- | ||
FOO | ||
{% embed foo %} | ||
{% block c1 %} | ||
{{ parent() }} | ||
block1extended | ||
{% endblock %} | ||
{% endembed %} | ||
|
||
BAR | ||
--TEMPLATE(foo.twig)-- | ||
A | ||
{% block c1 %} | ||
block1 | ||
{% endblock %} | ||
B | ||
{% block c2 %} | ||
block2 | ||
{% endblock %} | ||
C | ||
--DATA-- | ||
return array('foo' => 'foo.twig') | ||
--EXPECT-- | ||
FOO | ||
|
||
A | ||
block1 | ||
|
||
block1extended | ||
B | ||
block2 | ||
C | ||
BAR |