문제

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