m1roff/yii2-gii

yii2-gii官方模块的有用扩展

安装: 21

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:yii2-extension

2.0.1 2022-09-08 17:42 UTC

This package is auto-updated.

Last update: 2024-09-08 22:09:03 UTC


README

安装

安装此扩展的首选方法是通过 composer.

运行以下命令

composer require --dev m1roff/yii2-gii "^2.0"

配置

将以下行添加到 main-local.php 配置文件中

if (!YII_ENV_TEST) {
    ...
    
    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        'allowedIPs' => ['*'],
        'generators' => [ //here
            'model' => [ // generator name
                'class' => 'm1roff\gii\generators\model\Generator', // generator class
                'templates' => [ //setting for out templates
                    'myModel' => '@m1roff/gii/generators/model/default', // template name => path to template
                ]
            ],
            'crud' => [ // generator name
                'class' => 'm1roff\gii\generators\crud\Generator', // generator class
                'templates' => [ //setting for out templates
                    'myCrud' => '@m1roff/gii/generators/crud/default', // template name => path to template
                ]
            ],
        ],
    ];
}