Sunday, January 8, 2012

How to Use Controller Generator (Gii Tool - Yii Code Generator)

Once we have made previous models in the example application of Model Generator (Gii Tool - Yii Code Generator), we proceed again on making the controller. Controller Generator helps you to quickly generate a new controller class, one or several controller actions and their corresponding views. The following implementation steps Controller Generator (Gii Tool - Yii Code Generator)
  1. Login to Gii - http://localhost/webappname/index.php?r=gii/default/login 
  2. Then click on the menu Controller Generator - http://localhost/webappanme/index.php/gii/controller
  3. Fill Controller ID with a user (in accordance with the table we have made)

  4. Click preview and then generate.


    Generating code using template "D:\xampp\htdocs\yii\framework\gii\generators\controller\templates\default"... generated controllers\UserController.php generated views\user\index.php done!


  5. Click to try it now or go to this link http://localhost/webappname/index.php/user, and see the results

2 comments:

Yii Framework Tutorials