0
社區不同的圖像的URL,Symfony3資產 - 在督促和開發環境
我開始與代碼:
myTwig.html.twig
{% block stylesheets %}
{% stylesheets filter='?uglifycss' filter='cssrewrite' output='styles/output/main/main.css'
'styles/css/home.css'
[...]
%}<link rel="stylesheet" href="{{ asset_url }}" />{% endstylesheets %}
{% endblock %}
home.css
.mainContainer {
background: url('../../images/background.png') no-repeat center center;
}
如果我運行php app/console assetic:dump --env=prod --no-debug
,則symfony在/web/styles/output/main
中創建文件main.css
和main_home_1.css
。那就對了。但問題是,兩個文件中的背景網址不同。
的main.css(PROD)
background:url("../images/background.png") no-repeat center center;
main_main_1.css(DEV)
background: url("../../../../images/background.png") no-repeat center center;
在DEV-環境的URL是正確的。但是爲什麼這些網址在同一個目錄中時會有所不同。我該如何解決它?