Пример #1
0
 public function renderGameFen(Game $game, User $user = null)
 {
     $player = $game->getPlayerByUserOrCreator($user);
     $authUser = $this->container->get('security.context')->getToken()->getUser();
     if ($authUser instanceof User && ($authPlayer = $game->getPlayerByUser($authUser))) {
         $gameUrl = $this->getUrlGenerator()->generate('lichess_player', array('id' => $authPlayer->getFullId()));
     } else {
         $gameUrl = $this->getUrlGenerator()->generate('lichess_game', array('id' => $game->getId(), 'color' => $player->getColor()));
     }
     return sprintf('<a href="%s" title="%s" class="mini_board parse_fen" data-color="%s" data-fen="%s"></a>', $gameUrl, $this->getTranslator()->trans('View in full size'), $player->getColor(), Forsyth::export($game));
 }