"Inhalt Anhängen", um einen block von mehreren subtemplates

gibt es mehrere Fragen auf, wie fügen Sie einen block mit ast. Die Antwort ist immer mit der Vererbung und verwenden, und rufen Sie dann die parent(). Irgendwie weiß ich nicht, wie das funktioniert in meinem konkreten Fall:

Basis.html-Code.Zweig

{% block content %}{% endblock %}
{% block appendable %}
{% endblock %}
{% block another_appendable %}
{% endblock %}

Website.html-Code.Zweig

{% extends base.html.twig %}
{% block content %}
{# Here use/include/embed, i dont know #}
{% use sub1.html.twig %}
{% use sub2.html.twig %}
{% endblock content %}

sub1.html-Code.Zweig

Some content that should be directly rendered
{% block appendable %}
some stuff that should be added to appendable
{% endblock %}
{% block another_appendable %}
This content should be added to "another appendable"
{% endblock %}

sub2.html-Code.Zweig

{% block appendable %}
additional stuff that should be appended
{% endblock %}

Möchte ich, dass sowohl Inhalte von sub1 und sub2 gerendert werden innerhalb von appendable. Wie könnte ich das erreichen?

InformationsquelleAutor m0c | 2013-01-28
Schreibe einen Kommentar