- Open yii code generator - http://localhost/webappname/index.php?r=gii/default/login
- Select Crud Generator and enter the name of your model you created in the Model Generator.
It should be noted that the use of uppercase and lowercase letters should be tailored to the name of the Model Class we have made to the Model Generator. In the previous example the discussion of Model Generator, Model name is its Class User (letter U in the word using the letters of the user). And select preview and cetang all existing Code File and click generate.
generated controllers\UserController.php
generated views\user\_form.php
generated views\user\_search.php
generated views\user\_view.php
generated views\user\admin.php
generated views\user\create.php
generated views\user\index.php
generated views\user\update.php
generated views\user\view.php
- To view the results please click on try it now or go on http://localhost/webappname/index.php/user
- To operate the CRUD (Create-Read-Update-Delete), you must first login. Open http://localhost/webappname/index.php/site/login
- Then go again http://localhost/webappname/index.php/user/. You can see there is not a user.
- Have you gone to http://localhost/webappname/index.php/user/create. to create a new user - Create User
- If you have made, you can see it back in http://localhost/webappname/index.php/user/index - User List
- To Manage User (Create-Read-Update-Delete), you can open it in http://localhost/webappname/index.php/user/admin - Manage Users (View, Update, Delete)
Monday, January 9, 2012
How to Use Crud Generator (Gii Tool - Yii Code Generator)
How to Use Controller Generator (Gii Tool - Yii Code Generator)" and also the model on the post "How to Use Model Generator (Gii Tool - Yii Code Generator)", I would go again in How to Use Crud Generator (Gii Tool - Yii Code Generator). CRUD (Create Read Update Delete) generator generates a controller and views that implement CRUD operations for the specified data model. Please follow these steps below to use this generator:
After I have discussed previously the Controller of making post "
Yii Framework Tutorials
Subscribe to:
Post Comments (Atom)
Nice article. It helped me a lot. I didn't understand these concepts after reading the yii book. But your article was pretty easy to understand. Thanks for sharing.
ReplyDeleteNice article. I'm extremely new to Yii. I'm playing with a fresh install as I type this. Anyway, for clarification, I'm guessing that I'll want to setup at least one user after the model user / crud user step, but before the creating roles, assigning admin to the first created user, etc. under authManager. Does that make sense?
ReplyDeleteNice article.... :)
ReplyDeleteIt helped me a lot. Your article was very easy to understand....
Thanks
Very Very Nice post
ReplyDeleteIt is a great post for every blog and for me. Obviously I want to say that this is very important post for learn. Thanks..
ReplyDeleteHire Yii Framework Developers