1

有两个树枝文件src/MyVendor/MyBundle/Resources/views/MyApp/layout.html.twigsrc/MyVendor/MyBundle/Resources/views/MyApp/myView.html.twig

src/MyVendor/MyBundle/Resources/views/MyApp/myView.html.twig的内容

{% extends "layout.html.twig" %}
{% block content %}
   view content is here.
{% endblock %}

但我收到一个错误

Unable to find template "layout.html.twig" in
"MyVendorMyBundle:MyApp:myView.html.twig"
4

1 回答 1

7

你应该这样做:

{% extends "MyVendorMyBundle:MyApp:layout.html.twig" %}

您可以在文档中找到更多详细信息

于 2012-10-31T09:11:59.910 回答