You need to generate/create the bundle AcmeBlogBundle
first and add the bundle to the kernel in app/AppKernel.php
.
Otherwise Doctrine doesn't know about the alias AcmeBlogBundle:
that is used to resolve the class to an entity. Doctrine can't resolve the alias to an existing namespace and doesn't know where to put the Entity
class.
Run the following command to create ie the AcmeBlogBundle
bundle.
app/console generate:bundle --namespace=Acme\Bundle\AcmeBlogBundle
Your AppKernel.php
should now contain the line:
public function registerBundles()
{
$bundles = array(
// ...
new Acme\Bundle\AcmeBlogBundle(),
);
// ...
return $bundles;
Afterwards the error message will be gone and you'll be able to generate your Entity with:
app/console doctrine:generate:crud --entity=AcmeBlogBundle:Entity
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.