public function getModulPesonalia() { return $this->hasOne(ModulPersonalia::className(), ['id' => 'MODUL_ID']); }
/** * DepDrop CHILD MODUL * @author ptrnov <*****@*****.**> * @since 1.1 */ public function actionModulChild() { $out = []; if (isset($_POST['depdrop_parents'])) { $parents = $_POST['depdrop_parents']; if ($parents != null) { $modul_prn = $parents[0]; $model = ModulPersonalia::find()->asArray()->where(['MODUL_PRN' => $modul_prn])->all(); foreach ($model as $key => $value) { $out[] = ['id' => $value['ID'], 'name' => $value['MODUL_NM']]; } echo json_encode(['output' => $out, 'selected' => '']); return; } } echo Json::encode(['output' => '', 'selected' => '']); }