简体   繁体   中英

symfony2 - the assetic assetic:dump command doesn't create stylesheets correctly

For some reason I can't load the css files. Here is the structure of the bundle that I use

BD
 WebsiteBundle
   public
     css

And here is how I try to load the css files

{% stylesheets 'bundles/bdwebsite/css/*' filter='cssrewrite' %}
    <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}

I did assetic:dump

What I'm doing wrong?

You referred to bundles/bdwebsite/css/* in your stylesheets tag.

This way assetic looks for all css files in web/bundles/bdwebsite/css (a folder that currently does not exist) and not in src/BD/WebsiteBundle/public/css .

In order to have your files in the right place before executing assetic:dump ...

... use app/console assets:install web which will copy them to the web folder...

... or my recommendation app/console assets:install web --symlink for symlinks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM