Я создал новый пакет с app / console. Пытаюсь распечатать простое приветствие, чтобы двигаться дальше. Я автоматически загрузил пространство имен, зарегистрировал пакет, создал страницу, но Symfony обнаруживает исключение:
Bundle "PageBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() function of your AppKernel.php file?
Но я это уже сделал.
Журнал показывает:
[2011-06-08 23:41:56] request.CRITICAL: InvalidArgumentException: Bundle "PageBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() function of your AppKernel.php file? (uncaught exception) at /Applications/MAMP/htdocs/Symfony/app/bootstrap.php.cache line 634
Я также очистил кешированную папку dev. Может ли кто-нибудь помочь мне разобраться, что не так. Я делал это раньше, это первый раз, когда у меня возникла эта проблема. Что-то связанное с bootstrap.php.cache
Спасибо! Цените всю помощь.
КОД:
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\DoctrineBundle\DoctrineBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Webmuch\PageBundle\WebmuchPageBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Symfony\Bundle\WebConfiguratorBundle\SymfonyWebConfiguratorBundle();
}
return $bundles;
}
Пакет также отображается как активный пакет в профилировщике.
$bundles[] = new Webmuch\PageBundle\WebmuchPageBundle();
Замените на этот:$bundles[] = new Webmuch\PageBundle\PageBundle();
Предположим, он должен работать;) - person btbvoy   schedule 12.02.2012