这是我的代码:
{% block js %}
{% javascripts filter='?yui_js' output='js/m/myfiles.js'
'@MyBundle/Resources/public/js/m/one.js'
'@MyBundle/Resources/public/js/m/two.js'
'@MyBundle/Resources/public/js/m/three.js'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
我希望能够根据变量更改我的输出值。
像这样的东西:
{% set myOutput = 'js/m/myfiles_v2.js'%}
{% block js %}
{% javascripts filter='?yui_js' output=myOutput
'@MyBundle/Resources/public/js/m/one.js'
'@MyBundle/Resources/public/js/m/two.js'
'@MyBundle/Resources/public/js/m/three.js'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
但是当我这样做时,我得到“意外的令牌”名称“价值“myOutput”(“字符串”预期)。有没有办法解决这个问题?