我在twig中有这个代码块:
{% javascripts
'@CommonBundle/Resources/public/js/*'
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
在开发环境中,它编译为:
<script src="/js/96bb269_part_16_main_1.js"></script>
<script src="/js/96bb269_part_16_mwheelIntent_2.js"></script>
<script src="/js/96bb269_part_16_plugins_3.js"></script>
但是我想在dev env的网址中使用真正的源路径:
<script src="/CommonBundle/Resources/public/js/main.js"></script>
<script src="/CommonBundle/Resources/public/js/test/mwheelIntent.js"></script>
<script src="/CommonBundle/Resources/public/js/foobar/plugins.js"></script>
输出参数在这种情况下不是解决方案(它适用于空洞块,但不适用于每个<script>
行),我只想停止编译dev env的资产网址(或者修改此方法)。我需要做什么?感谢。
答案 0 :(得分:0)
您必须将真实资源复制到web/bundles
目录。为此,在symfony控制台