Exemple #1
0
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $model = new School('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['School'])) {
         $model->attributes = $_GET['School'];
     }
     $this->render('index', array('model' => $model));
 }
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     if ($this->CanAccess("admin")) {
         $model = new School('search');
         $model->unsetAttributes();
         // clear any default values
         if (isset($_GET['School'])) {
             $model->attributes = $_GET['School'];
         }
         $this->render('admin', array('model' => $model));
     } else {
         throw new CHttpException(405, Yii::t('app', 'You do not have permissions to access this page.'));
     }
 }