我有这个错误:
捆绑包“AcmeOggyBundle”不存在或未启用。也许您忘记将它添加到 AppKernel.php 文件的 registerBundles() 方法中?
这是我registerBundles
在AppKernel.php
文件中的功能:
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new Acme\OggyBundle\OggyBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
我不明白...我包含 bundle new Acme\OggyBundle\OggyBundle()
,但收到错误消息说我的 bundle 不包括在内!为什么?
日志文件:
[2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Bridge\Monolog\Handler\FirePHPHandler::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Bridge\Monolog\Handler\ChromePhpHandler::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Sensio\Bundle\FrameworkExtraBundle\EventListener\CacheListener::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Component\HttpKernel\EventListener\ResponseListener::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Component\HttpKernel\Fragment\FragmentHandler::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Component\Security\Http\RememberMe\ResponseListener::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.response”到监听器“Symfony\Component\HttpKernel\EventListener\StreamedResponseListener::onKernelResponse”。[] [] [2013-06-13 10:46:20] event.DEBUG:通知事件“kernel.terminate”到监听器“Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener::onKernelTerminate”。[] []