Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
504 views
in Technique[技术] by (71.8m points)

symfony - Install assets from app directory

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...