Yii is organized using the Model-View-Controller (MVC) design pattern. Yii uses this mature technology in WEB programming to better separate the logic layer and presentation layer.
The model represents the data, business logic and rules; the view displays the output of the model; the controller accepts the input and output and transforms it Commands for models and views.
In addition to MVC, Yii applications also have the following parts: (Recommended learning: yii framework)
Entry script: A PHP script that can be directly accessed by end users and is responsible for starting a request processing cycle.
Application: An object that can be accessed globally, manages and coordinates components to complete requests.
Should Components used: Objects registered in the application provide different functions to complete requests.
Module: An independent package containing a complete MVC structure. An application can be composed of multiple modules.
Filter: The controller needs to trigger code execution before or after processing the request.
Widget: An object that can be embedded in a view, can contain controller logic, and can be called repeatedly by different views.
The diagram below shows the static structure of a Yii application:
The above is the detailed content of What is the application structure of yii framework?. For more information, please follow other related articles on the PHP Chinese website!