Good afternoon! I can not get a sample field from the related table "Clinics". Trying to get this:
public function actionOpinionsjson() { $one = ClinicOpinions::find() ->select(['id', 'text', 'clinic->name']) ->with('clinic') ->asArray() ->all(); \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return $one; } Does not work.
And if there is such a code, without conditions, on the displayed fields, then the data from the associated table falls.
public function actionOpinionsjson() { $one = ClinicOpinions::find() ->with('clinic') ->asArray() ->all(); \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return $one; } Thank!