页脚类未在Symfony2中加载

时间:2015-05-22 09:09:06

标签: symfony twig

我的layout.html.twig部分包含所有的bootstrap链接。在我的主twig文件中,我使用了以下代码。我无法加载页脚部分。我做错了什么?

{% extends 'HomeBundle:Main:layout.html.twig' %}
{% block title %}English{% endblock %}
{% block body %}
    <div id="sidebar">
        {% include "HomeBundle:Main:sidebar.html.twig "%}
    </div>

    <div id="site-content">

        {% include "HomeBundle:Main:content.html.twig"%}
    </div>
{% endblock %}

{% block footer %}
    <div id="footer">
        {% include "HomeBundle:Main:footer.html.twig"%}
    </div>
{% endblock %}

我的footer.html.twig文件包含

{% block footer %}

<div class="site-footer">
           <!--footer html codes --->
</div>

 {% endblock %}

我的layout.html.twig文件

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>{% block title %}Welcome!{% endblock %}</title>
    {% block stylesheets %}
       <!--bootstrap script-->
    {% endblock %}
    }}" />
</head>
<body>


    {% block body %}

    {% endblock %}
</div>
{% block javascripts %}
    <!-- my js scripts-->


{% endblock %}
</body>
</html>

1 个答案:

答案 0 :(得分:2)

{% block footer %}文件中删除{% endblock %}footer.html.twig