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 %}
有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top