Google News
logo
Yii framework - Interview Questions
What is Models in YII Framework?
Models are part of the MVC architecture. They are objects representing business data, rules and logic.
 
You can create model classes by extending yii\base\Model or its child classes. The base class yii\base\Model supports many useful features:
 
Attributes : represent the business data and can be accessed like normal object properties or array elements;

Attribute labels : specify the display labels for attributes;

Massive assignment : supports populating multiple attributes in a single step;

Validation rules : ensures input data based on the declared validation rules;

Data Exporting : allows model data to be exported in terms of arrays with customizable formats.

The Model class is also the base class for more advanced models, such as Active Record. Please refer to the relevant documentation for more details about these advanced models.
Advertisement