symfony管理包安装

问题描述 投票:1回答:1

我正在学习symfony奏鸣曲包,我用composer create-project symfony/website-skeleton sonata命令安装了symfony骨架项目,我进入了sonata目录并运行composer require sonata-project/admin-bundle命令作为symfonydoc的指南,我检查了所有的配置,如doc所说,以及cache:clearassets:install命令一切正常,我用php bin/console server:start开始我的服务器,但当我访问网址'http://localhost:8000/admin/dashboard'它报告错误,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.").

我之前用symfony创建了我的项目,但是我对webpack知之甚少,我的资产目录是空的,当我运行npm install时它工作正常,我不知道我错过了什么。

php symfony webpack symfony-sonata
1个回答
0
投票

在Symfony 4

  1. 创建空文件rootProject / public / build / manifest.json
  2. 插入此代码:enter image description here

{
    "bundles": {
        "Sonata\\AdminBundle\\SonataAdminBundle": ["all"]
    },
    "copy-from-recipe": {
        "config/": "%CONFIG_DIR%/",
        "src/": "%SRC_DIR%/"
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.