Welcome to the Yii Code Generator
With Gii configured and enabled, you may access Gii by navigating via http://localhost/<name_of_application>/index.php?r=gii. After successful entry of your password (unless you specified that a password should not be used, see Enabling Gii), you are presented with a menu page listing Gii's main features.
Controller GeneratorYou can try to create a new controller, so click on the Controller Generator menu item. This will bring you to a form that allows you to fill out the relevant details to create a new Yii controller class. You must fill out the Controller ID value and add an action ID value. Then click on the preview button, this will show you the files to be generated once you click on the generate button. See the screenshot below:
In addition to the controller class, Gii is also going to create a view file for each of the Action IDs that you have specified. You should notice that if message is the Controller ID then the corresponding class file will be named MessageController.php. Similarly, if you provide an Action ID value of hello, you can expect to have a method name in the controller called actionHello.
We will tackle more details about actions and controllers in future posts.
With Gii configured and enabled, you may access Gii by navigating via http://localhost/<name_of_application>/index.php?r=gii. After successful entry of your password (unless you specified that a password should not be used, see Enabling Gii), you are presented with a menu page listing Gii's main features.
Controller GeneratorYou can try to create a new controller, so click on the Controller Generator menu item. This will bring you to a form that allows you to fill out the relevant details to create a new Yii controller class. You must fill out the Controller ID value and add an action ID value. Then click on the preview button, this will show you the files to be generated once you click on the generate button. See the screenshot below:
In addition to the controller class, Gii is also going to create a view file for each of the Action IDs that you have specified. You should notice that if message is the Controller ID then the corresponding class file will be named MessageController.php. Similarly, if you provide an Action ID value of hello, you can expect to have a method name in the controller called actionHello.
We will tackle more details about actions and controllers in future posts.


No comments:
Post a Comment