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

好久不见. 提交于 2019-12-21 16:58:56

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/19255782/symfony2-the-assetic-asseticdump-command-doesnt-create-stylesheets-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!