Esempio n. 1
0
 /**
  * Creates a new Salud model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate($id)
 {
     $model = new Salud();
     $model->pro_sal = 43;
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         //return $this->redirect(['view', 'id' => $model->id_sal]);
         //Modificar con el ID del indicador en la encuesta
         $model_encuesta = \app\models\Factencuesta::findOne($id);
         $model_encuesta->id_sal = $model->id_sal;
         $model_encuesta->save();
         return $this->redirect(['atencion/create', 'id' => $id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }