Discover
School
University
Enterance
Competitive
Support
INR
Login
Sign Up
We use cookies, check our
Privacy Policies
.
Agree
Yii2 Programming
1 / 19
5%
Which of the following is the correct way to define a relationship between two models in Yii2?
Using the 'belongsTo' attribute in one model and the 'hasOne' attribute in the other.
Using the 'hasMany' attribute in one model and the 'belongsTo' attribute in the other.
Defining the relationship using the 'hasOne' or 'hasMany' attribute with the corresponding model name.
Using the 'foreignKey' attribute to link the models.
Previous
Next