Symfony2 Global / Site Wide Assets

I use assetic to manage my assets in a Symfony2 application. I wonder where I should place my global or local assets. Should they go into the / web or / app / Resources folder?

this is how i am doing things now but i'm not sure if this is the best practice. I searched for high and low 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 %} 
+6
source share
1 answer

Indeed, everything is fine. And there is even a third option, so that they are all in the "Core" package. It depends on how you want to organize your project and whether you are going to share your packages.

I would slightly lean back from storing directly in / web. Just because I almost always combine and reduce my assets, so for this reason it is easier / cleaner to keep them all out of the reach of a website, for example /app/Resources or /src/CoreBundle/Resources , and then allow assetic:dump or assets:install click on them to the correct location on the Internet.

+1
source

Source: https://habr.com/ru/post/919806/


All Articles