/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'update' page. */ public function actionCreate() { $model = new HtmlCode(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); // set attributes from get if (isset($_GET['HtmlCode'])) { $model->attributes = $_GET['HtmlCode']; } if (isset($_POST['HtmlCode'])) { $model->attributes = $_POST['HtmlCode']; 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)); }