NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
### 开启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 ![](https://box.kancloud.cn/04cbee9ba906c8b2b3af05b81fafb6b4_2558x1582.png) ![](https://box.kancloud.cn/2b87d03561de5f767de1bc272cb2e9a0_1852x1280.png) ### 开启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模块 即可访问 ![](https://box.kancloud.cn/d72f042fae1ca3512c50d1b3def99969_670x70.png)