Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image background with css rewrite #15

ardianys opened this issue Sep 10, 2012 · 6 comments

Image background with css rewrite #15

ardianys opened this issue Sep 10, 2012 · 6 comments


Copy link

@ardianys ardianys commented Sep 10, 2012

thanks for this great bundle,

I see in your docs

The most easies ways is to copy the glyphicons-halflings.png to your public img folder

cp /your/path/to/bootstrap/img/glyphicons-halflings.png to /path/to/your/bundle/Resources/public/img/

But, could you specify which bundle I have to copy into ?

I see your demo site, but you'r self use base64 in your demo site css.


Copy link

@phiamo phiamo commented Sep 10, 2012

into the bundle where you reference to bootstrap.less or css in your html
the base64 is generated by cssembed plugin of assetic

Copy link

@ardianys ardianys commented Sep 10, 2012

Thanks for your quick response,

I have check your answer,

but my generated css doesn't same with another my symfony app,
it's my generated css in my new app with your bundle

background-image: url("../../Resources/public/img/glyphicons-halflings.png");

and it's my usual generated css

background: url("../../bundles/jariffproject/img/show.png") no-repeat scroll left center transparent;

and it's my assetic config

# Assetic Configuration
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ "MopaBootstrapBundle"]
    #java: /usr/bin/java
        cssrewrite: ~
        #    jar: %kernel.root_dir%/Resources/java/compiler.jar
        #    jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar
            node: /usr/local/bin/node
            node_paths: [/usr/local/lib/node_modules]
            apply_to: "\.less$"

and it's my base.twig.html

      {% stylesheets
        <link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
      {% endstylesheets %}

Thanks for your answer. Regards.

Copy link

@ardianys ardianys commented Sep 10, 2012

Ok finally I got it,
But I have to made this directory in my app


not in some bundle which load the css.

But, maybe do you have another standard solution ?


Copy link

@phiamo phiamo commented Sep 10, 2012

no there is no standard solution.
sorry the prob for this files is some things about assetic and path
resolution in some cases.

Copy link

@csalazart csalazart commented Jun 19, 2014

Yes There Are One Solution..
is Implemente output Filter
{% stylesheets filter='cssrewrite' output='css/compiled/style.css'
Thats Mean the ../../ and Extra Directory is created and the Second sub up Directory is correcty set
So This is a very elegant and nice easy solution...

Copy link

@haghighisina haghighisina commented Jan 13, 2020

hello gus ,

does eny bodu know how to set up a pic on background in symfony 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

4 participants