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~~
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值