### 開啟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模塊
即可訪問
