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 %}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With