Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assetic unable to find file

I am trying to link a css file (that lives in a bundle) inside a twig template :

{% stylesheets 
    '@AcmeFooBundle/Resources/public/css/bootstrap.min.css' 
%}
    <link href="{{ asset_url }}" rel="stylesheet"/>
{% endstylesheets %}

The first error message I get is:

You must add AcmeFooBundle to the assetic.bundle config...

This is the config :

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        []
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        #closure:
        #    jar: %kernel.root_dir%/Resources/java/compiler.jar
        #yui_css:
        #    jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar

Then I try to add AcmeFooBundle in the bundles directive but then I get an error:

Unable to find file....

I can't understand what I am doing wrong here...

Dumping the default configs of the assetic configuration in the console (using php app/console config:dump-reference assetic ) I can see AcmeFooBundle bundle listed in the bundles directive...

like image 273
Nikos Avatar asked Apr 29 '12 23:04

Nikos


1 Answers

Unless you need to whitelist some bundles for Assetic, just remove the bundles option from the config.

like image 82
Elnur Abdurrakhimov Avatar answered Sep 28 '22 06:09

Elnur Abdurrakhimov