定制 ismaambrosi/generator-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ismaambrosi/generator-bundle

Composer 安装命令:

composer require ismaambrosi/generator-bundle

包简介

Generates Symfony2 documents, forms and CRUD

README 文档

README

Build Status Total Downloads Latest Stable Version Latest Unstable Version SensioLabsInsight

This bundle extends the commands provided by SensioGeneratorBundle, adding a MongoDB document generator and CRUD generators for those MongoDB documents.

Installation

Add the bundle to your project.

Add the requirement to composer:

$ php composer.phar require ismaambrosi/generator-bundle

You will also need to install the DoctrineMongoDBBundle. The instructions on how to install it are available in the Symfony2 documentation.

Enable the bundle in your kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    // ...
    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        // ...
        $bundles[] = new IsmaAmbrosi\Bundle\GeneratorBundle\IsmaAmbrosiGeneratorBundle();
    }
}

It is recommended to disable this bundle for the production environment.

Commands

This bundle contains three commands that will allow you to generate code for documents, forms and CRUD controllers. These commands can be executed either on interactive mode or manual mode. I would recommend you to use the interactive mode.

Generating ODM documents

The first command allows to generate the document classes.

Examples:

$ php app/console doctrine:mongodb:generate:document
$ php app/console doctrine:mongodb:generate:document \
--document=AcmeBlogBundle:Blog/Post \
--with-repository

Generating forms

With the second command we can generate the form type classes, used by the form component.

Example:

$ php app/console doctrine:mongodb:generate:form AcmeBlogBundle:Post

Generating the CRUD

The last command generates the CRUD controllers, with read-only actions to handle the documents that were generated previously. It also allows to include the write actions, for creating, updating and deleting documents.

Examples:

$ php app/console doctrine:mongodb:generate:crud
# Specifying the document and the routing prefix
$ php app/console doctrine:mongodb:generate:crud \
--document=AcmeBlogBundle:Post \
--route-prefix=post_admin
# Specifying the document, routing and write-actions
$ php app/console doctrine:mongodb:generate:crud \
--document=AcmeBlogBundle:Post \
--route-prefix=post_admin --with-write

统计信息

  • 总下载量: 93.74k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 26
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 26
  • Watchers: 3
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-03-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固