<?php

$config = [
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => '',
        ],
    ],
];

if (!YII_ENV_TEST) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        'generators' => [ //在这里加入配置
            'controller' => [ //生成器名称
                'class' => 'yii\gii\generators\controller\Generator', //生成器类名
                'templates' => [ //setting for out templates
                    'myController' => '@app/../vendor\yiisoft\yii2-gii\myTemplate\controller' //模板名称 => 模板路径
                ],
            ],
            'crud' => [ //生成器名称
                'class' => 'yii\gii\generators\crud\Generator', //生成器类名
                'templates' => [ //setting for out templates
                    'myCrud' => '@app/../vendor\yiisoft\yii2-gii\myTemplate\crud' //模板名称 => 模板路径
                ],
            ],
            'module' => [ //生成器名称
                'class' => 'yii\gii\generators\module\Generator', //生成器类名
                'templates' => [ //setting for out templates
                    'myModule' => '@app/../vendor\yiisoft\yii2-gii\myTemplate\module' //模板名称 => 模板路径
                ],
            ],
            'extension' => [ //生成器名称
                'class' => 'yii\gii\generators\extension\Generator', //生成器类名
                'templates' => [ //setting for out templates
                    'myExtension' => '@app/../vendor\yiisoft\yii2-gii\myTemplate\extension' //模板名称 => 模板路径
                ],
            ],
            'form' => [ //生成器名称
                'class' => 'yii\gii\generators\form\Generator', //生成器类名
                'templates' => [ //setting for out templates
                    'myForm' => '@app/../vendor\yiisoft\yii2-gii\myTemplate\form' //模板名称 => 模板路径
                ],
            ],
            'model' => [ //生成器名称
                'class' => 'yii\gii\generators\model\Generator', //生成器类名
                'templates' => [ //setting for out templates
                    'myModel' => '@app/../vendor\yiisoft\yii2-gii\myTemplate\model' //模板名称 => 模板路径
                ],
            ],
        ],
    ];
}

return $config;
