我对 Doctrine Bundle 有疑问。当我尝试进入网页时出现错误:
DoctrineBundle 未在您的应用程序中注册。
这很奇怪,因为在 config/bundles.php 我有:
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
];
如何添加适用于应用程序的 Doctrine Bundle?或者也许是教义/orm的东西?谢谢你的帮助。
编辑
当我在控制器中转储 $this 时,在 services.kernel.bundles 中我有:
["DoctrineBundle"]=>
object(Doctrine\Bundle\DoctrineBundle\DoctrineBundle)#73 (6) {
["autoloader":"Doctrine\Bundle\DoctrineBundle\DoctrineBundle":private]=>
NULL
["name":protected]=>
string(14) "DoctrineBundle"
["extension":protected]=>
NULL
["path":protected]=>
NULL
["namespace":"Symfony\Component\HttpKernel\Bundle\Bundle":private]=>
string(30) "Doctrine\Bundle\DoctrineBundle"
["container":protected]=>
*RECURSION*
}
}