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

1

5

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?

Usm answered 8/10, 2013 at 18:45 Comment(5)
so what's the URL look like in the html the browser receives? Is it the proper url for what you'd have to enter to manually hit the css file?Markley
There is no url for the css files in the html file.Usm
so the browser is receiving href=""?Markley
No. There is no <link rel="stylesheet"... tagUsm
javascript "import" works fine.Usm
L
13

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.

Lacker answered 8/10, 2013 at 19:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.