/**
  * Lists all Categories models.
  * @return mixed
  */
 public function actionIndex()
 {
     if (Yii::$app->user->can('watcher')) {
         $searchModel = new CategoriesSearch();
         $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
         return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     } else {
         throw new ForbiddenHttpException();
     }
 }
Esempio n. 2
0
 /**
  * Lists all Categories models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new CategoriesSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }