Symfony2 - Assetic - load images in CSS

后端 未结 9 2089
逝去的感伤
逝去的感伤 2020-11-29 17:38

I have a CoreBundle that contains main css files and images. Now I have a problem when I load an image from css; the image isn\'t shown.

 background-image:ur         


        
9条回答
  •  粉色の甜心
    2020-11-29 18:08

    I have a similar problem, and I've looked around for at least a day, and I'm not convinced there's a good practical solution to this problem. I recommend using Assetic to handle javascript and css, and then just putting your images in the docroot of your web site. For example, if you have a css file that references ../images/file.png, just create and images folder under your docroot and put file.png in there. This is definitely not the best theoretical solution, but it's the only one I could find that actually works.

提交回复
热议问题