예제 #1
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new UserRole('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['UserRole'])) {
         $model->attributes = $_GET['UserRole'];
     }
     $this->render('admin', array('model' => $model));
 }
예제 #2
0
 public function actionRole()
 {
     $model = new UserRole();
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['UserRole'])) {
         $model->attributes = $_GET['UserRole'];
     }
     $provider = new CActiveDataProvider('UserRole', array('sort' => array('defaultOrder' => 'id DESC'), 'Pagination' => array('PageSize' => 5)));
     $provider->criteria = $model->search('name not like "guest"');
     $this->render('listrole', array('model' => $model, 'provider' => $provider));
 }