Answer the question
In order to leave comments, you need to log in
How to properly link models on view?
Good afternoon. Can you tell me how to properly link models in yii2?
There is a simple model that has another model attached to it.
Store - id, name , id_city
City - id, name
What is the correct way to get this link, call it in the controller?
type
Магазин::find()->joinWith('Город')->where('ид'=>$id)->one();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question