Alex Rivera | Logout

Install assets from app directory

Asked 2012-12-09T06:04:51.537
11

Here is my directory structure

/app/Resources/public
/app/Resources/public/css
/app/Resources/public/iamges
/app/Resources/public/js

I need to install these assets to /web directory. What is the right way to do it? I've tried app/console install:assets but it installs assets only from bundles. Is it possible to store global assets in app directory?

Edit
Report

1 Answer

14

Your global assets should go directly into the web folder. There is no need to put them in the app folder and then copy them!

The install:assets or assetic:dump command are for assets which belong to one bundle only and which are kept inside this bundle to make them reusable.

What you can do though is to keep the assets which belong to your application in your "application bundle". Most of the time you got at least one bundle which is not reusable, representing your application core. I keep my base templates (base.html.twig) and the main assets in there so I can use assetic:dump on them!

answered 2012-12-10T09:14:53.827

Your Answer