public function actionCreate() { $model = new ImageGroup(); $data = Yii::app()->getRequest()->getPost('ImageGroup'); if ($data) { $model->setAttributes($data); if ($model->save()) { Yii::app()->ajax->success(Yii::t('StoreModule.store', 'The group is successfully created')); } } Yii::app()->ajax->error(Yii::t('StoreModule.store', 'Failed to create group')); }