打开protected\config\main.php修改以下代码
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'你的密码',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
),
浏览器输入localhost/项目名/index.php?r=gii你会看到如下界面
输入设定密码便可看到yii自动化代码生成工具列表
- Controller Generator 控制器创建工具
- Crud Generator 为数据模型的CRUD操作创建控制器和视图
- Form Generator 表单创建工具
- Model Generator 模型创建工具
- Module Generator