public function actionCreate() { $this->actionName = "New Data"; $model = new UserLevel(); if (isset($_POST['UserLevel'])) { $model->setAttributes($_POST['UserLevel']); if ($model->save()) { Yii::app()->user->setFlash('success', "Data saved!"); $this->redirect(array('index')); } } $this->render('create', array('model' => $model)); }