### 开启Gii
在config/web.php文件中配置ip地址
```
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
'allowedIPs' => ['192.168.10.1', '::1'], //这里配置访问机器的IP地址
];
}
```
在web/index.php
```
defined('YII_ENV') or define('YII_ENV', 'dev'); //开启开发模式
```
### 访问Gii
打开网址+r=gii进入gii配置页面
### 生成module


### 开启module
```
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
'allowedIPs' => ['192.168.10.1', '::1'],
];
//添加以下内容
$config['modules']['admin'] = [
'class' => 'app\modules\admin',
];
}
```
### 访问admin模块
即可访问

