Yii自动生成项目

来源:互联网 发布:匈牙利算法步骤 编辑:程序博客网 时间:2024/05/16 16:12

Yii自动生成项目 

我喜欢尝试新鲜的东西。以前一直用gii生成工具,前几天突然发现用shell的方法,感觉很不错。特此总结一下yii的几个命令。

 

        gii的工具页面:

            - ControllerGenerator

            - CrudGenerator

            - FormGenerator

            - ModelGenerator

            - ModuleGenerator

 

        shell对应的命令  

            -controller

            - crud

            -form

            -help

            -model

            -module 

 

一、gii生成方法:

        first:打开gii模块

            'modules'=>array(

            'gii'=>array(

            'class'=>'system.gii.GiiModule',

            'password'=>'EnterYour Password Here',

            //If removed, Gii defaults to localhost only. Edit carefully to taste.

            'ipFilters'=>array('127.0.0.1','::1'),

                ),

            ),

        second:打开gii的管理页面

        alocalhost/webappname/index.php?r=gii 

        b、密码即为

Enter Your Password Here,可更改。    

//======备注:有可能需要注释掉

'urlManager'模块,它定义的url重写方式会使你无法访问。

 

二、shell生成方法: 

        first:打开dos下项目目录

        例如:C:\Documents andSettings\adways>d:

                    D:\>cdD:\phpws\yii_blog_comment

                    D:\phpws\yii_blog_comment>D:\phpws\yii_blog_comment\yii\framework\yiic shell ../index.php

                   >> model tbl_visitor

        万事ok了,一步到位~

 

Add: yiic生成项目:  

        first:打开dos下目标目录 

        例如:C:\Documents andSettings\adways>d: 

                  D:\>cdD:\php\yii\framework\

                   D:\php\yii\framework>yiic webapp d:\php\nima

       over~~

 

原创粉丝点击