Gabriel Theron Gabriel Theron - 2 months ago 14
PHP Question

Symfony2 : cannot load resource "."

I'm having an issue with assets management in Symfony2. I keep getting the following error :

Cannot load resource ".".


I've been trying to fix it in my config and routing files for dev environment, but the only thing I really did was changing the
use_controller
to
false
in the
config_dev.yml
file.

I keep summoning my resources in my templates with

{% stylesheets '@MyBundle/Resources/public/css/style.css'
filter='cssrewrite' %}
<link rel="stylesheet" href="{{ asset_url }}" type="text/css" />
{% endstylesheets %}


and I keep getting the exception :

Cannot load resource ".".


Any tips on what could go wrong? (I've cleared the cache several times)

Thanks in advance

Edit :

I've tried removing :

_assetic:
resource: .
type: assetic


from my routing_dev.yml file, and the error disappears (with, of course, the resources in my page)

Reedit :

After a complete reinstallation, it seems to be working again. Probably some property I had changed unvoluntarily... Case closed.

Answer

Try to run the following commands:

php app/console assets:install web
php app/console assetic:dump
Comments