public function actionIndex() { $this->pageName = Yii::t('app', 'CATEGORIES'); $this->breadcrumbs = array(Yii::t('app', 'SYSTEM') => array('admin/index'), $this->pageName); $model = new UserGroup('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['UserGroup'])) { $model->attributes = $_GET['UserGroup']; } $this->render('index', array('model' => $model)); }
/** * Manages all models. */ public function actionAdmin() { $model = new UserGroup('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['UserGroup'])) { $model->attributes = $_GET['UserGroup']; } $this->render('admin', array('model' => $model)); }
/** * Manages all models. */ public function actionAdmin() { if ($this->user_role == 'top_admin') { $model = new UserGroup('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['UserGroup'])) { $model->attributes = $_GET['UserGroup']; } $this->render('admin', array('model' => $model)); } else { $this->redirect(array('site/index')); } }