claudejanz/yii2-mygii

双模型生成器 Gii

安装量: 19,751

依赖项: 3

建议者: 0

安全: 0

星标: 5

关注者: 2

分支: 3

公开问题: 1

类型:yii2-extension

0.0.11 2017-12-14 10:52 UTC

This package is auto-updated.

Last update: 2024-09-11 18:28:08 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

此生成器为指定的数据库表生成两个 ActiveRecord 类。一个是空的,可以扩展,另一个是基础类,与原始模型生成器相同。

安装

通过 composer 安装此扩展是首选方式。

运行以下命令之一:

$ php composer.phar require "claudejanz/yii2-mygii": "dev-master"

或者将以下内容添加到你的 composer.json 文件的 require 部分:

"claudejanz/yii2-mygii": "dev-master"

```

使用方法

//if your gii modules configuration looks like below:
    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = 'yii\gii\Module';

//remove this two lines
//Add this into common/config/main-local.php
    'bootstrap' => 'gii',
    'modules' => [
        'gii' => [
            'class' => 'yii\gii\Module',
            'generators' => [
                'doubleModel' => [
                    'class' => 'claudejanz\mygii\generators\model\Generator',
                ],
                'kartik-crud' => [
                    'class'     => 'claudejanz\mygii\generators\kcrud\Generator',
                ],
            ],
        ],
    ],