我需要包含一个带有块的twig文件,但是这个文件将被添加到不同的地方。该文件是这样的:
HTML CODE BLABLA
{% block javascript %}
<script>
Code associated with the html
</script>
{% endblock %}
用include,插入所有但不尊重的命令块。 此外,我可以使用“使用”加载模板,但我无法访问变量:S
{% include 'file.html.twig' %} No respect block
{% use 'file.html.twig' %} cant access vars
我该怎么办? (对不起我的英文)