Symfony2 - Assetic - load images in CSS

后端 未结 9 2088
逝去的感伤
逝去的感伤 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:14

    I solved the problem by following the instructions on this site: http://www.craftitonline.com/2011/06/symfony2-beautify-with-assetic-and-a-template-part-ii/

    The actual problem is that you reference your bundle resources absolute, but must reference them relative.

    {% stylesheets filter='cssrewrite' output='css/*.css'
        'bundles/blistercarerisikobewertung/css/*'  %}
        
    {% endstylesheets %}
    

    Clear your cache and install your assets again

提交回复
热议问题