/** * Creates a new resource */ public function actionCreate() { $this->hasPrivilege(Acl::ACTION_CREATE); $this->pageTitle = Lang::t('Add ' . $this->resourceLabel); $model = new UserResources(); $model_class_name = $model->getClassName(); if (isset($_POST[$model_class_name])) { $model->attributes = $_POST[$model_class_name]; if ($model->save()) { Yii::app()->user->setFlash('success', Lang::t('SUCCESS_MESSAGE')); $this->redirect(array('index')); } } $this->render('create', array('model' => $model)); }