示例#1
0
 public function __invoke()
 {
     $games = $this->gameRepository->findAll();
     $viewGames = [];
     /** @var Game $game */
     foreach ($games as $game) {
         $viewGames[$game->owner()->displayName()][] = $game->title();
     }
     $viewData['gamesList'] = $viewGames;
     $this->view->display('games.html', $viewData);
 }
示例#2
0
 public function __invoke()
 {
     $title = $this->request->post('gamename');
     $this->gameRepository->createGameUnsafe($title, $this->currentUser);
     $this->redirector->redirect(303, '/games');
 }