/** * Updates an existing ProyectoAlcance model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); //Listas desplegables $unidadMedida = UnidadMedida::find()->all(); $instanciaInstitucion = InstanciaInstitucion::find()->all(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['proyecto/view', 'id' => $model->id_proyecto]); } else { return $this->render('update', ['model' => $model, 'unidadMedida' => $unidadMedida, 'instanciaInstitucion' => $instanciaInstitucion]); } }
/** * @return \yii\db\ActiveQuery */ public function getInstanciaInstitucionVinculado() { return $this->hasOne(InstanciaInstitucion::className(), ['id' => 'vinculado_especifique']); }