【发布时间】:2017-02-21 21:41:47
【问题描述】:
我用 symfony 2.3 创建了一个包,但在这种情况下(因为我的老师问我)在src/ 文件夹之外,所以我有../symfony/fuentes/NameBundle 而不是../symfony/src/NameBundle。新行出现在 AppKernel 中,我的新包出现在 routing.yml 上,但是当我尝试启动服务器时
Bundle generation
Generating the bundle code: OK
Checking that the bundle is autoloaded: FAILED
Confirm automatic update of your Kernel [yes]?
Enabling the bundle inside the Kernel: OK
Confirm automatic update of the Routing [yes]?
Importing the bundle routing resource: OK
The command was not able to configure everything automatically.
You must do the following changes manually.
- Edit the composer.json file and register the bundle
namespace in the "autoload" section:
我已经编辑自动加载并尝试了很多东西(在这里寻找),但总是出现相同的错误。
C:\Users\Akenateb\Documents\UOC\AULAMENTOR\Symfony>php app/console server:run 127.0.0.1:8080
PHP Fatal error: Class 'AulaMentor\ExdosBundle\AulaMentorExdosBundle' not found in C:\Users\Akenateb\Documents\UOC\AULAMENTOR\Symfony\app\AppKernel.php on line 20
有人可以帮助我吗?我真的很坚持。 提前致谢。
【问题讨论】:
-
他为什么要问这样的问题?
-
您似乎也在运行 app/console generate:bundle 命令?
-
i.am.michiel - 因为我正在做运动
-
Cerad - 是的,我使用 generate:bundle 命令没有问题
-
@i.am.michiel 想象一下,您自己制作了一个孤立的本地捆绑包,但您至少不希望将其放入 git 存储库中。