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是正确的。但是为什么这些网址在同一个目录中时会有所不同。我该如何解决它?