【问题标题】:Twig file path for twig-extends树枝扩展的树枝文件路径
【发布时间】:2012-10-31 09:09:11
【问题描述】:

有两个 twig 文件 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"

【问题讨论】:

    标签: symfony twig extends


    【解决方案1】:

    你应该这样做:

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

    您可以在documentation找到更多详细信息

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-20
    • 1970-01-01
    • 1970-01-01
    • 2022-01-02
    • 1970-01-01
    相关资源
    最近更新 更多