6

I am using assetic to manage my assets in a Symfony2 application. I am wondering where I should be placing my global or site wide assets. Should they go in the /web folder or /app/Resources folder?

here is how I am currently doing things but I am not sure if this is best practice. I have searched high and low for recommendations.

{% stylesheets filter='less'
   '../app/Resources/public/less/test.less'
   '@MopaBootstrapBundle/Resources/bootstrap/less/bootstrap.less'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
{% endstylesheets %}
Mike
  • 12,359
  • 17
  • 65
  • 86

1 Answers1

1

Really, either is fine. And there's even a third option of having them all in a "Core" bundle. It depends on how you want to organize your project and if you intend to share your bundles.

I would slightly lean away from storing directly in /web. Only because I almost always combine and minify my assets so for this reason it's easier/cleaner to keep them all in a non-web-accessible location like /app/Resources or /src/CoreBundle/Resources and then let assetic:dump or assets:install push them to the proper web location.

MDrollette
  • 6,887
  • 1
  • 36
  • 49
  • The documentation seems to push you strongly in that direction: http://symfony.com/doc/current/book/page_creation.html#bundle-directory-structure – cartbeforehorse Aug 10 '13 at 14:08