树枝延伸的树枝文件路径

时间:2012-10-31 09:09:11

标签: symfony twig extends

有两个twig文件 src / MyVendor / MyBundle / Resources / views / MyApp / layout.html.twig src / 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"

1 个答案:

答案 0 :(得分:7)

你应该这样做:

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

您可以在documentation

中找到更多详情