Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do Symfony2 shared CSS and JS assets go, best practice wise?

Tags:

symfony

I normally place my JS and CSS Assetic assets inside a DefaultBundle, but I suppose the best place to put them would be in the app/Resources/public/(js|css) folders.

Also, to reference assets we use:

{% javascripts filter="" output="js/core.js" debug=true     "@DefaultBundle/Resources/public/js/jquery-1.6.2.js" %}     <script src="{{ asset_url }}" type="text/javascript"></script> {% endjavascripts %} 

How do I go about referencing shared assets like jQuery and my CSS reset stylesheets in app/Resources/public/...?

like image 529
josef.van.niekerk Avatar asked Aug 01 '11 19:08

josef.van.niekerk


1 Answers

You could also use this:

{% stylesheets '../app/Resources/public/css/*' %}     <link href="{{ asset_url }}" type="text/css" rel="stylesheet" /> {% endstylesheets %} 
like image 115
David Cramblett Avatar answered Nov 12 '22 02:11

David Cramblett