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