2014-01-24 36 views
2

我在树枝这个代码块:Symfony2中,在assetic源路径URL的开发环境

{% javascripts 
    '@CommonBundle/Resources/public/js/*' 
<script src="{{ asset_url }}"></script> 
{% endjavascripts %} 

在开发ENV它是在类似编译:

<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> 

在这种情况下输出参数不是解决方案(它适用于空洞块,但n每个<script>行),我只是想停止编译dev env的资产url(或者可能修改此方法)。我需要做什么?谢谢。

+0

我相信这是你想要的 - http://symfony.com/doc/current/cookbook/assetic/asset_management.html#dumping-asset-files-在开发环境 – antony

+0

你应该发布这个答案,愚蠢。 :) – Tek

回答

0

您必须将真实资源复制到web/bundles dir。为此使用一些内置适当的命令在symfony控制台

+1

它如何帮助我?我已经有了符号链接。以及Symfony btw如何使用web/bundles目录? –

+0

请阅读[docs](http://symfony.com/doc/current/cookbook/assetic/asset_management.html)。也许这将是有用的 –

+0

我读过很多遍,在我的情况下没有解决方案。 –