سؤال

I have problem with assetic in symfony. Stylesheet part does not work at all in dev environment (css styles are not applied to the document) and in production environment everything is ok except resources are not linked correctly for fontawesome

I am using bower and my .bowerrc file:

{
    "directory": "src/Acme/AdminBundle/Resources/public/3rdparty"
}

My config.app file:

assetic:
    debug:          "%kernel.debug%"
    use_controller: true
    bundles:        ["AcmeAdminBundle"]
    filters:
        cssrewrite: ~
        yui_css:
            jar: "%kernel.root_dir%/../bin/yuicompressor.jar"
        yui_js:
            jar: "%kernel.root_dir%/../bin/yuicompressor.jar"

and finally the layout.html.twig

{% stylesheets filter='cssrewrite,yui_css' output='css/3rdparty.css'
    '@AcmeAdminBundle/Resources/public/3rdparty/bootstrap/dist/css/bootstrap.css'
    '@AcmeAdminBundle/Resources/public/3rdparty/fontawesome/css/font-awesome.css'
%}
        <link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}

output

هل كانت مفيدة؟

المحلول

This is a known issue that causes the cssrewrite filter to fail when using the @AcmeFooBundle syntax for CSS Stylesheetsdocument.

In other words, you can't use @AcmeFooBundle and cssrewrite filter together.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top