The model is a CModel or its subclass instance. The model is used to maintain data and related business logic. A model is a separate data object. It can be a row in a data table or a user-input form. Each word of the data object...
The model is a CModel or its subclass instance. The model is used to maintain data and related business logic.
A model is a separate data object. It can be a row in a data table or a user-input form. Each field of the data object corresponds to an attribute in the model. Each attribute has a label and can be verified by a series of rules.
Yii implements two types of models: Form model and Active Record model. Both of them inherit from the same base class CModel.
The form model is an instance of CFormModel. The form model is used to maintain the data obtained from user input. The data is often obtained, used, and discarded. For example, on a logon page, we can use a form model to indicate the user name and password provided by the end user. For more details, see use forms.
Active Record (AR) is a design pattern used to abstract database access through an object-oriented style. Each AR object is an instance of CActiveRecord or its subclass. Represents a row in the data table. The fields in the row correspond to the attributes in the AR object.
The above is the Yii Framework official guide series 8-basic knowledge: the content of the model. For more information, see The PHP Chinese network (www.php1.cn )!