2
嫩枝模板開始,我有這樣的細枝模板:在Symfony2中
{% block javascripts %}
{% javascripts '@AibFrontendBundle/Resources/public/js/update.js' %}
<script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js'></script>
<script src="{{ asset_url }}" type="text/javascript"></script>
{% endjavascripts %}
{% endblock %}
{% block content %}
<div id="contents">
{{ contents|raw }}
</div>
<form action="{{ path('homepage') }}" method="post">
{{ form_widget(form) }}
<input type="submit" />
</form>
{% endblock %}
它正確顯示的內容。
但是,如果我在開始時
{% extends 'AibFrontendBundle::layout.html.twig' %}
添加下面這條線這表明layout.html.twig的內容,但我上面提到的內容沒有任何表現出更多..
如何再次顯示內容?
您能向我們展示您的layout.html.twig模板嗎? – greg0ire
layout.html.twig裏面我寫了「aib」。 – ziiweb