/** * Creates a new Cliente model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Cliente(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'nome' => $model->nome, 'tel' => $model->tel]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Cliente model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Cliente(); $model->owner = Yii::$app->user->identity->getId(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->idCliente]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Cliente model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Cliente(); //$model->sexo = 'Masculino'; //$model->estado = 'RN'; //$model->naturalidade_uf = 'RN'; //$model->estadocivil = 'Solteiro'; if ($model->load(Yii::$app->request->post()) && $model->save()) { // \yii\helpers\VarDumper::dump($model,10,true); //die; return $this->redirect(['cliente/create']); } else { return $this->render('create', ['model' => $model]); } }