src/Controller/PageController.php line 77

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Predis\Client;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\HttpFoundation\Response;
  6. class PageController extends BaseController
  7. {   
  8.     
  9.     private Client $redis;
  10.     public function __construct(Client $redis)
  11.     {
  12.         $this->redis $redis;
  13.     }
  14.     
  15.     private function getHistory(): array
  16.     {
  17.         $historyRaw $this->redis->lRange('game_history'09);
  18.         return array_map(fn($item) => json_decode($itemtrue), $historyRaw);
  19.     }
  20.     
  21.     /**
  22.      * @Route("/", name="main_page")
  23.      */
  24.     public function index(): Response
  25.     {
  26.         return $this->render('main.html.twig', [
  27.             'history' => $this->getHistory(),
  28.         ]);
  29.     }
  30.     /**
  31.      * @Route("/mines", name="mines_page")
  32.      */
  33.     public function mines(): Response
  34.     {
  35.         return $this->render('mines.html.twig', [
  36.             'history' => $this->getHistory(),
  37.         ]);
  38.     }
  39.     
  40.     /**
  41.      * @Route("/nvuti", name="nvuti_page")
  42.      */
  43.     public function nvuti(): Response
  44.     {
  45.         return $this->render('nvuti.html.twig', [
  46.             'history' => $this->getHistory(),
  47.         ]);
  48.     }
  49.     
  50.     /**
  51.      * @Route("/lobby", name="lobby_page")
  52.      */
  53.     public function lobby(): Response
  54.     {
  55.         return $this->render('lobby.html.twig');
  56.     }
  57.     
  58.     /**
  59.      * @Route("/tournament", name="tour_page")
  60.      */
  61.     public function tournament(): Response
  62.     {
  63.         return $this->render('tournament.html.twig');
  64.     }
  65.     
  66.     /**
  67.      * @Route("/bonus", name="bonus_page")
  68.      */
  69.     public function bonus(): Response
  70.     {
  71.         return $this->render('bonus.html.twig');
  72.     }
  73.     
  74.     /**
  75.      * @Route("/referal", name="referal_page")
  76.      */
  77.     public function referal(): Response
  78.     {
  79.         return $this->render('referal.html.twig');
  80.     }
  81.     
  82.     /**
  83.      * @Route("/profile", name="profile_page")
  84.      */
  85.     public function profile(): Response
  86.     {
  87.         return $this->render('profile.html.twig');
  88.     }
  89.     
  90.     /**
  91.      * @Route("/faq", name="faq_page")
  92.      */
  93.     public function faq(): Response
  94.     {
  95.         return $this->render('faq.html.twig');
  96.     }
  97.     
  98.     /**
  99.      * @Route("/support", name="support_redirect")
  100.      */
  101.     public function support(): Response
  102.     {
  103.         return $this->redirectTo('https://vk.me/candy1_win3');
  104.     }
  105. }