纠正我如果我错了,但不可能在继承布局的块之外使用 html 代码,对吗?
这就是我的意思
{# app/Resources/view/base.html.twig #}
<!DOCTYPE html>
......
<% block sidebar %>
<h1>...</h1>
<% endblock; %>
{# src/Acme/CoolBundle/Controller/page.html.twig #}
{% extends '::base.html.twig' %}
{% block sidebar %}
{{ parent{} }}
<p>Lorem ipsum bla bla.. </p> // This one works and the paragraph is rendered
{% endblock }
<h3>Latest news</h3> // Here I get A template that extends another one cannot have a body in...