/** * Creates a new Sede model. * If creation is successful, the browser will be redirected to the 'view' page. * @param integer $establecimiento_id * @return mixed */ public function actionCreate($establecimiento_id) { $establecimiento = Establecimiento::findOne($establecimiento_id); $model = new Sede(); $model->establecimiento_id = $establecimiento_id; if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['establecimientos/' . $model->establecimiento_id . '/sedes/view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }