访问新Bundle报错
1
2
3(1/1) ClassNotFoundException
Attempted to load class "AppBundle" from namespace "Bundles\AppBundle".
Did you forget a "use" statement for another namespace?打开 composer.json 文件,修改如下:
1
2
3
4
5
6"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
}修改后运行
composer dump-autoload
生成实体类报错
1
2[RuntimeException]
Namespace "Bundles\CommonBundle" does not contain any mapped entities.打开 config.yml, 配置 doctrine, 添加 mappings
orm: mappings: CommonBundle: ~ #CommonBundle: # type: yml # dir: Resources/config/doctrine
Symfony3 相关问题
- 本文链接: http://sevming.github.io/Symfony/symfony-questions.html
- 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!