yii2 使用gii生成代码文件

访问地址:

http://localhost/yii2-test/web/index.php?r=gii

 如果你通过本机以外的机器访问 Gii,请求会被出于安全原因拒绝。 在web.php修改gii配置:

1 $config['modules']['gii'] = [
2         'class' => 'yii\gii\Module',
3         'allowedIPs' => ['*', '::*'],
4     ];

之后就可生成对应的模块代码了

生成controller:

访问地址:

http://localhost/yii2-test/web/index.php?r=hero

 

posted @ 2017-07-12 17:22  L狗哥  阅读(635)  评论(0编辑  收藏  举报