public function actionCategory($categoryId)
 {
     $category = TrainingCategory::findOne($categoryId);
     if (empty($category)) {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
     $params = Yii::$app->request->queryParams;
     $params['categoryId'] = $categoryId;
     $searchModel = new TrainingRepository();
     $dataProvider = $searchModel->search($params);
     return $this->render(['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'categoryName' => $category->name]);
 }
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('frontend.main', function ($view) {
         $view->with('teamData', Team::find(config('mls.team_id')));
         $view->with('trainingData', TrainingRepository::getActiveList(config('mls.team_id')));
     });
 }
 public function index()
 {
     $team = Team::find(config('mls.team_id'));
     $playerList = PlayerRepository::getActiveListByTeamId($team->id);
     $gameList = GameRepository::getListByTeamId($team->id);
     $trainingList = TrainingRepository::getActiveList($team->id);
     $statList = StatRepository::getPlayersStatistics($playerList);
     return view('frontend.teams.view')->with('team', $team)->with('playerList', $playerList)->with('gameList', $gameList)->with('trainingList', $trainingList)->with('statList', $statList);
 }