search

Home  >  Q&A  >  body text

symfony - Is it possible to directly reference the resource file without using the assets:install command to copy the resource file to the web directory?

$php app/console assets:install target [--symlink]
The Resource/public folder of the bundle is copied to the /web directory. Can the resource files under Resources/public be directly referenced in the template engine?

天蓬老师天蓬老师2783 days ago713

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-16 16:48:01

    For flexibility, the physical path of the bundle can be arbitrary. Under this premise, if the resource files in the bundle can be publicly accessed, it is equivalent to opening web access permissions for multiple directories, which is not only troublesome, but also unsafe. .

    In addition, Symfony 2’s AsseticBundle can do much more (assetic:dump) than just copying files, such as:

    1. Splicing css, js and other files
    2. Compress css, js code
    3. Perform graphics editing (such as adding watermarks), and what is saved in the bundle is only the original image, which has many benefits
    4. Wait...

    reply
    0
  • Cancelreply