Code Generation using Command Line Tools (deprecated)
In the above, we use the yiic shell
command to interact with ourskeleton application. At the prompt, we execute two sub-commands: model User tbl_user
and crud User
. The former generates a model class named for the tbl_user
table,while the latter analyzes the User
model and generates the code implementingthe corresponding CRUD operations.
Let's enjoy our work by browsing the following URL:
This will display a list of user entries in the tbl_user
table.
Repeat the above steps to add more users. Notice that user list pagewill automatically paginate the user entries if there are too many to bedisplayed in one page.
If we login as an administrator using , we can view the useradmin page with the following URL:
This will show us the user entries in a nice tabular format. We can click on the tableheader cells to sort the corresponding columns. We can click on the buttonson each row of data to view, update or delete the corresponding row of data.We can browse different pages. We can also filter and search to look forthe data we are interested in.
User admin page
Create new user page