public function getLocalizationData($id) { $data = DctSolidFoodLoc::find()->with('dctLanguage')->where(['dct_solid_food_id' => $id])->asArray()->all(); $modelLoc = []; foreach ($data as $solid_food) { $modelLoc[$solid_food['dct_language_id']] = ['text' => $solid_food['text'], 'id' => $solid_food['dct_solid_food_loc_id']]; } return $modelLoc; }
/** * Lists all DctSolidFoodLoc models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => DctSolidFoodLoc::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }