Yii自动生成项目

 

 

我喜欢尝试新鲜的东西。以前一直用gii生成工具,前几天突然发现用shell的方法,感觉很不错。特此总结一下yii的几个命令。
 
gii的工具页面:
- Controller Generator
- Crud Generator
- Form Generator
- Model Generator
- Module Generator
 
shell对应的命令
- controller
- crud
- form
- help
- model
- module
 
一、gii生成方法:
first:打开gii模块
'modules'=>array(
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'Enter Your Password Here',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
),
second:打开gii的管理页面
a、localhost/webappname/index.php?r=gii
b、密码即为
Enter Your Password Here,可更改。
//======备注:有可能需要注释掉
'urlManager'模块,它定义的url重写方式会使你无法访问。
 
二、shell生成方法:
first:打开dos下项目目录
例如:C:\Documents and Settings\adways>d:
D:\>cd D:\phpws\yii_blog_comment
D:\phpws\yii_blog_comment>D:\phpws\yii_blog_comment\yii\framework\yiic shell
>> model tbl_visitor
万事ok了,一步到位~
 
Add: yiic生成项目:
first:打开dos下目标目录
例如:C:\Documents and Settings\adways>d:
D:\>cd D:\php\yii\framework\
D:\php\yii\framework>yiic webapp d:\php\nima
over~~
posted @ 2013-07-17 11:42  jshaibozhong  阅读(334)  评论(0编辑  收藏  举报