更多内容: http://blog.yuhai.win
- 在config/web.php 中添加配置文件
if (YII_ENV_DEV) {
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
];
}
- 保证web/index.php 中包含
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
通过地址 http://localhost/yii/basic/web/index.php?r=gii 可以进行相关代码的生成
ip限制 可以在config/web.php 中设置 相关的IP限制规则,设置之后不能通过验证的ip会出现
Forbidden (#403) 的提示
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs'=>['192.168.*'],
];
}
本文在有道云笔记的地址(有道云笔记中保持最新的状态):
http://note.youdao.com/yws/public/redirect/share?id=e85e15ed957337d18e48016993994c80&type=false