share js /css between bundles


If you want to share common assets among all your bundles, the best choice is to place them in theapp/Resources/public directory. For example:
app/Resources/Public
|-- css
|   `-- base.css
|-- js
|   `-- jquery.js
Then you can reference them in your layout as follow:
{% block stylesheets %}
  {% stylesheets '../app/Resources/public/css/*' %}
    
  {% endstylesheets %}
{% endblock %}

{% block javascripts %}
  
  {% javascripts '../app/Resources/public/js/*' %}
    
  {% endjavascripts %}
{% endblock %}

评论

热门帖子