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