【发布时间】:2018-07-25 08:01:17
【问题描述】:
我正在学习symfony sonata bundle,我用composer create-project symfony/website-skeleton sonata命令安装了symfony骨架项目,我进入sonata目录并运行composer require sonata-project/admin-bundle命令作为symfonydoc上的指南,我检查了所有配置作为医生说,cache:clear 和 assets:install 命令都可以正常工作,我用php bin/console server:start 启动了我的服务器,但是当我访问 url '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 时它也可以正常工作,我不知道我错过了什么。
【问题讨论】:
-
我打开了我的'public'目录,我只能在它下面找到bundles'directory'和index.php文件,'bundles'目录下有'sonataadmin'和'sonatacore'目录,没有“build”目录或“public”目录下的任何“manifest.json”文件
-
回答here帮助?
-
@Dragos,是的,第一个答案有效,我将 'assets.yaml' 中的 'assets' 选项设置为 '~',它有效,非常感谢!
-
运行
yarn install应该会自动为您执行这些操作。
标签: php symfony webpack symfony-sonata