Yii is organized using the Model-View-Controller (MVC) design pattern. The model represents data, business logic, and rules; the view displays the model's output; and the controller accepts inputs and converts them into model and view commands.
In addition to MVC, Yii applications also have the following parts:
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.
Application component: an object registered in the application, providing different functions to complete requests.
Module: an independent package containing a complete MVC structure. An application can be composed of multiple modules.
Filter: The code that the controller needs to trigger 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: