/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate($tag = null, $name = null, $font_color = null, $background_color = null) { $model = new Vlan(); /* Set attributes by _GET */ if (!is_null($tag) && !isset($_POST['Vlan'])) { $model->tag = (int) $tag; } if (!is_null($name) && !isset($_POST['Vlan'])) { $model->name = (string) trim($name); } if (!is_null($font_color) && !isset($_POST['Vlan'])) { $model->font_color = (string) trim($font_color); } if (!is_null($background_color) && !isset($_POST['Vlan'])) { $model->background_color = (string) trim($background_color); } // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Vlan'])) { $model->attributes = $_POST['Vlan']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }