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