symfony - Symfony2 - Images In CSS with Assetic -


Edit: I think a third party bundle has been found, in which there is a bit of configuration, which I see appears to be completed: currently it The only disadvantage is that there is no type of cash busting, however, saying that the functionality was as simple as forking / patching and the composer had to add the necessary dependencies.

I still welcome any official / recommended methods of completing this, but now it works very well that I 'm comfortable in using it in production.

I am recently diving into Simfoni 2 and giving myself to make the project more familiar with the structure. Here's my setup:

  & lt ;! - base.html.twig - & gt; & Lt; Top & gt; & Lt; Title & gt; Page & lt; / Title & gt; {% Block stylesheets%} {% stylesheets bundle / website / less / *. Low output = 'asset / css / output.css' filter = 'lessphp, cssrewrite'%} & lt; Link rel = "stylesheet" href = "{{Asset_url}}" & gt; {% Stylesheet%} {% endblock%} & lt; / Head & gt;   

Inside a low file:

  / * main.less * / body {background: url ('../ images / bg.jpg') ; }   

I have run the php app / console assets: install the web - symlinks and php app / console additive: dump which Uses the Cssrewrite filter, generates CSS file and sets the path of the image to '../../ bundles / website / images / bg.jpg' It works fine

However, I'm kicking in my OCD and I am trying to find a way to get all images referenced in the CSS file so that web / web / Before placing a deployment before.

Before I'm going and want to come up with some obscene way to accomplish it, any simple method is an easy way to get referenced pictures within the CSS files, with property Also handled: Dump?

I still welcome any official / recommended methods of completing this, but now it works very well that I am comfortable to use it in production.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -