/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'update' page. */ public function actionCreate() { $model = new StockGroup(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); // set attributes from get if (isset($_GET['StockGroup'])) { $model->attributes = $_GET['StockGroup']; } if (isset($_POST['StockGroup'])) { $model->attributes = $_POST['StockGroup']; if ($model->save()) { $url = isset($_POST['go_to_list']) ? $this->listUrl('index') : $this->itemUrl('update', $model->id); $this->redirect($url); } } $this->render('create', array('model' => $model)); }