0
votes

I have added a css file to src/MyApp/MyBundle/Resources/public/css/my.css

Using assetic how do I include it? I've tried {% stylesheets 'bundles/myapp_my/css/*' filter='cssrewrite' %} but it's not coming through.

Is the bundles/myapp_my/css/* format correct?

I've followed http://symfony.com/doc/current/cookbook/assetic/asset_management.html but I'm really not clear on what format (see the line above) I should be using. An underscore separating the app name from the first word of the bundle?

Any help appreciated, thanks.

Edit: the full code I'm using to include it is this:

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

1 Answers

2
votes

That is correct, but then afterwards, you have to do app/console assets:install; app/console assetic:dump to use everything in the production environment. If you are using dev, the controller should serve up the files dynamically so you can edit it on the fly.