[ 'class' => AccessControl::className(), 'rules' => [ [ //'actions' => ['cabinet','change-password', 'bookmarks', 'projects'], 'allow' => true, 'roles' => [ '@' ], ], ], ], ]; } public function actionIndex() { $model = new CommentProjectSearch([ 'scenario' => CommentProjectSearch::SCENARIO_SEARCH ]); $groups = CommentProject::find() ->select([ 'COUNT(*)', 'state', ]) ->asArray() ->indexBy('state') ->where([ 'user_id' => \Yii::$app->user->getId() ]) ->groupBy([ 'state' ]) ->column(); $comments = $model->search(\Yii::$app->request->queryParams); return $this->render('projects', [ 'comments' => $comments, 'groups' => $groups, ]); } }