/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $this->hasPrivilege(Acl::ACTION_CREATE); $this->pageTitle = Lang::t(Constants::LABEL_CREATE . ' ' . $this->resourceLabel); $model = new ModulesEnabled(); $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)); }