您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Yii2.0使用Gii生成代码

2025/8/28 4:31:23发布34次查看
开启gii
config/web.php:
$config = [ ... ]; if (yii_env_dev) { $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = 'yii\gii\module'; }
在web/index.php中设置yii_env_dev:
defined('yii_env') or define('yii_env', 'dev');
如果是从非localhost访问需要在配置文件中作如下设置:
'gii' => [ 'class' => 'yii\gii\module', 'allowedips' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'] // adjust this to your needs ],
测试:
http://hostname/index.php?r=gii
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product