I created a new package with app / console. Trying to get a simple hello printed, so I can move on. I automatically loaded the namespace, registered the package, created the page, but Symfony detected an exception:
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?
But I already did it.
The log displays:
[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
I also cleaned the cached dev folder. Can someone help me figure out what happened. I have done this before, this is the first time I have had this problem. Something related to bootstrap.php.cache
Thank! Appreciate all the help.
CODE:
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;
}
The packet is also displayed as an active bundle in the profiler.
source
share