【问题标题】:Symfony cmf generate:bundle optionSymfony cmf generate:bundle 选项
【发布时间】:2013-06-19 12:01:30
【问题描述】:

为什么,从概念上讲,symfony cmf 应用程序控制台内部没有生成包。 我已经尝试过 php app/console generate:bundle,但它不起作用。

【问题讨论】:

    标签: symfony symfony-cmf


    【解决方案1】:

    Symfony CMF 只是 Symfony2 全栈框架,带有一些额外的包和扩展。

    generate:bundle 命令是来自SensioGeneratorBundle 的命令。该捆绑包包含在 symfony 标准版中,但不包含在 symfony cmf 标准版中。只需安装该捆绑包,您就可以开始使用了:

    $ php composer.phar require sensio/generator-bundle:2.3.*
    
    // app/AppKernel.php
    
    // ...
    public function registerBundles()
    {
        // ...
    
        if (...) {
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle()
        }
    }
    

    【讨论】:

      【解决方案2】:

      generate:bundle bundle 命令由SensioGeneratorBundle 提供。

      composer.json

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

      将它添加到您的 composer.json 中,更新,在app/AppKernel.php 中注册捆绑包,该命令将可用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-05-16
        • 1970-01-01
        • 1970-01-01
        • 2016-05-08
        • 1970-01-01
        • 1970-01-01
        • 2015-11-21
        相关资源
        最近更新 更多