/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new DictionaryData(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['DictionaryData'])) { $model->attributes = $_POST['DictionaryData']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. * * @return void */ public function actionCreate() { $model = new DictionaryData(); $gid = (int) Yii::app()->getRequest()->getQuery('gid'); if ($gid) { $model->group_id = $gid; } if (($data = Yii::app()->getRequest()->getPost('DictionaryData')) !== null) { $model->setAttributes($data); if ($model->save()) { Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('DictionaryModule.dictionary', 'Record was added!')); $this->redirect((array) Yii::app()->getRequest()->getPost('submit-type', ['create'])); } } $this->render('create', ['model' => $model]); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. * * @return void */ public function actionCreate() { $model = new DictionaryData(); $gid = (int) Yii::app()->getRequest()->getQuery('gid'); if ($gid) { $model->group_id = $gid; } // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (($data = Yii::app()->getRequest()->getPost('DictionaryData')) !== null) { $model->setAttributes($data); if ($model->save()) { $this->redirect((array) Yii::app()->getRequest()->getPost('submit-type', array('create'))); } } $this->render('create', array('model' => $model)); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. * * @return void */ public function actionCreate() { $model = new DictionaryData(); $gid = (int) Yii::app()->getRequest()->getQuery('gid'); if ($gid) { $model->group_id = $gid; } // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (($data = Yii::app()->getRequest()->getPost('DictionaryData')) !== null) { $model->setAttributes($data); if ($model->save()) { Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('DictionaryModule.dictionary', 'Record was added!')); $this->redirect((array) Yii::app()->getRequest()->getPost('submit-type', array('create'))); } } $this->render('create', array('model' => $model)); }