Search code examples
phpassetssymfonyassetic

Symfony 3.1.3 not loading assets


I installed Symfony 3.1.3 and yesterday I lost whole day to figure out why symfony's not loading css files, I'm using Assetic bundle, I followed steps from documentation, I also watched videos on youtube, dumped assets, cleared cache but still nothing.. So, I have this code in base twig:

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

I also tried to specify concrete file path but 404 not found.

any ideas?


Solution

  • Usually, after updating the cache, you will want to install the assets too:

    In Symfony 3: php bin/console assets:install web --symlink

    In Symfony 2: php app/console assets:install web --symlink