Automatic Code Generation
From version 1.1.12, Yii includes a web-based code generation tool called Gii. It does supercedes the previous but still useful tool called yiic, the shell generation tool that run on the command line (see Creating your Web Application with yiic).
Enable Gii
To use Gii, you must modify the application configuration located at protected/config/main.php. To enable Gii, you must uncomment the gii module. The code auto generated by yiic (see Creating your Web Application with yiic) already added the Gii configuration, but it is commented out. All you need to do is uncomment and also add you own password as shown below:
'modules'=>array(
// uncomment the following to enable the Gii tool
/* <- remove this to enable Gii
'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'),
),
*/ <- remove this to enable Gii
// uncomment the following to enable the Gii tool
/* <- remove this to enable Gii
'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'),
),
*/ <- remove this to enable Gii
),
**Note** you can specify the password value as false then the module will not require a password. Since the ipFilters property is specified to only allow access to the localhost machine, it is safe to
set the password to false for you local development environment.
set the password to false for you local development environment.
You can now navigate to the tool via http://localhost/<name_of_application>/index.php?r=gii
HAPPY DAYS!!!
No comments:
Post a Comment