/** * Creates a new Loja model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Loja(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => Yii::$app->user->getId()]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Loja model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Loja(); $model->estado = 'RN'; if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index', 'id' => $model->idloja]); } else { return $this->render('create', ['model' => $model]); } }