Why, conceptually, there is not inside symfony cmf app console generate bundle. I have tried php app/console generate:bundle, but it doesn't work.

有帮助吗?

解决方案 2

The generate:bundle bundle command is provided by SensioGeneratorBundle.

composer.json

require:    
    ...
    "sensio/generator-bundle": "2.3.*@dev"

Add it to your composer.json , update, register the bundle in app/AppKernel.php and the command will be available.

其他提示

Symfony CMF is just the Symfony2 full-stack framework with some extra bundles and extensions.

The generate:bundle command is a command from the SensioGeneratorBundle. That bundle is included in the symfony standard edition, but not in the symfony cmf standard edition. Just install that bundle and you should be good to go:

$ php composer.phar require sensio/generator-bundle:2.3.*
// app/AppKernel.php

// ...
public function registerBundles()
{
    // ...

    if (...) {
        $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle()
    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top