After introducing the basic concepts in Yii, we now explain the general development process when using Yii to develop web applications. The development process here assumes that we have completed the requirements analysis and necessary design analysis of the application.
Create a directory structure skeleton. The yiic
tool mentioned in Creating the First Web Application can quickly implement this step.
Configure this application. This is achieved by modifying the application configuration file. This step may also require writing some application components (such as user components).
Create a model class for each type of data managed. The Gii
tools described in Creating First Yii Application and Automatic Code Generation can be used to quickly create active record classes for each data table. Create a Controller class for each type of user request. How to classify user requests depends on actual needs. Generally speaking, if a model class needs to be accessed by users, it should have a corresponding controller class. Gii
Tools can also automate this step.
Implement actions and their corresponding views. This is the real work that needs to be done.
Configure the necessary action filters in the controller class.
If you need theme functionality, create a theme.
If internationalization (I18N) is required, create translation information.
Apply appropriate caching techniques to cacheable data points and view points.
Final adjustment and deployment.
In each of the above steps, you may need to create and execute test cases.
The above is the Yii Framework Official Guide Series 14 - Basic Knowledge: Development Process. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!