I have a css file and an image in a bundle directory according these paths:
My_project
+-src
+-Project
+-MyBundle
+-Resources
+-public
+-css
+-MyCSSfile.css
+-images
+-MyImage.jpeg
In my view I call my css using assetic:
{% stylesheets 'bundles/myBundle/css/MyCSSfile.css' filter='cssrewrite' %}
<link rel="stylesheet" href="{{ asset_url }}"/>
{% endstylesheets %}
In my CSS I use:
background-image: url('../images/background.jpg');
Obviously it doens't work. The url which is returned by symfony is: "http://localhost:8888/MY_Project/web/bundles/myBundle/css/bundles/myBundle/images/background.jpg".
Any idea? Please