search

Home  >  Q&A  >  body text

What command is used to add js/css/image files to symfony src/ and synchronize them to the web/ folder?

Symfony src/bundle/Resource/public Add js/css/image file, what command is synchronized to the web/ folder?

I am not familiar with symfony. Now add the resource files in the src/ directory and web/.

phpcn_u1582phpcn_u15822829 days ago566

reply all(2)I'll reply

  • 阿神

    阿神2017-05-16 16:48:04

    $ php app/console assetic:dump

    For detailed documentation, see: http://symfony.com/doc/current/cookbo...

    Friendly advice is to read the document thoroughly before writing code, which will be more efficient:)

    EDIT:

    assetic:dump is provided by Symfony's AsseticBundle (relying on kriswallsmith's Assetic): https://github.com/symfony/AsseticBun..., which has more functions, such as splicing files, compressing files, and image processing.

    assets:install is provided by Symfony's FrameworkBundle: https://github.com/symfony/symfony/bl..., which is responsible for copying files to the public web directory (symlink can also be used under nix)

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 16:48:04

    Create shortcuts to static resources in the /web directory

    app/console assets:install web --symlink

    Merge resource files (in prod mode)

    app/console assetic:dump --env=prod

    reply
    0
  • Cancelreply