YII2通过GII创建后台模块

1.访问gii/Module Generator 模块 创建后台模块

Module Class:app\modules\admin

Module ID:admin


2.配置后台模块 config/web.php

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
    ];

    $config['modules']['admin'] = [  //添加admin模块
        'class'=>'app\modules\admin'
    ];
}


你可能感兴趣的:(YII2通过GII创建后台模块)