简体   繁体   中英

symfony admin bundle installation

I am learning the symfony sonata bundle, I installed the symfony skeleton project with composer create-project symfony/website-skeleton sonata command, and I enter into sonata directory and run composer require sonata-project/admin-bundle command as the guide on symfonydoc , I checked all the configurations as the doc said, and the cache:clear and assets:install command all work fine, I started my server with php bin/console server:start , but when I visit the url ' http://localhost:8000/admin/dashboard ' it reports error, An exception has been thrown during the rendering of a template ("Asset manifest file "/Users/kazuma/www/sonata/public/build/manifest.json" does not exist.").

I made my project with symfony before, but I don't know much about the webpack, my asset directory is empty, when I run npm install it works fine too, I don't know what I've missed.

in Symfony 4

  1. Create le the empty file rootProject/public/build/manifest.json
  2. insert this code : enter image description here

 { "bundles": { "Sonata\\\\AdminBundle\\\\SonataAdminBundle": ["all"] }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/", "src/": "%SRC_DIR%/" } } 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM