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