小枝でブロックを追加する方法についていくつかの質問があります。答えは常に継承を使用し、使用してからparent()を呼び出すことです。どういうわけか、これが私の特定のケースでどのように機能するのかわかりません:
base.html.twig
{% block content %}{% endblock %}
{% block appendable %}
{% endblock %}
{% block another_appendable %}
{% endblock %}
site.html.twig
{% 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.twig
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.twig
{% block appendable %}
additional stuff that should be appended
{% endblock %}
sub1 と sub2 の両方のコンテンツが追加可能内にレンダリングされることを望みます。どうすればそれを達成できますか?