Creating the AR model class
Now that we have the tbl_project table created, we need to create the Yii model class to allow us to easily manage the data in that table. We introduced Yii's Object -relational Mapping (ORM) layer and Active Record (AR), back in Chapter 1, Meet Yii. Now we will see a concrete example of that in the context of this application.
Previously, we used the yiic shell command to help with some autogeneration of code. As we saw in Chapter 2, Getting Started when we were using the shell command to create our first controller, there are many other shell commands you can execute to help auto create application code. However, as of version 1.1.2 of Yii, there is a new and more sophisticated interface available called Gii. Gii is a highly customizable and extensible web-based code generation platform that takes the yiic
shell command to new heights. We will be using this new platform to create our new model class.
Configuring Gii
Before we can start using Gii, we have to configure...