src/Controller/Pages/ProgramController.php line 33

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Pages;
  3. use App\Controller\System;
  4. use App\Kernel;
  5. use App\Controller\AbstractKasController;
  6. use App\Controller\Database;
  7. use App\Controller\PageInfo;
  8. use Symfony\Component\HttpFoundation\JsonResponse;
  9. use Symfony\Component\HttpFoundation\RequestStack;
  10. use Symfony\Component\Routing\Annotation\Route;
  11. use Symfony\Component\HttpFoundation\Response;
  12. use App\Controller\Objects\Page;
  13. use Symfony\VarDumper;
  14. class ProgramController extends AbstractKasController
  15. {
  16.     public function __construct(RequestStack $requestStackDatabase $dbPageInfo $pageInfo)
  17.     {
  18.         parent::__construct($requestStack$db$pageInfo);
  19.         $this->request $requestStack->getCurrentRequest();
  20.         $this->model = new ProgramModel($db);
  21.     }
  22.     /**
  23.      * @Route("/program-html-{id}", methods={"GET"})
  24.      * @Route("/program-kino-html-{id}", methods={"GET"})
  25.      * @Route("/program-html-{id}/{week}", methods={"GET"})
  26.      * @Route("/program-kino-html-{id}/{week}", methods={"GET"})
  27.      * @return Response
  28.      */
  29.     public function programKinoData($idstring $week ''):Response
  30.     {
  31.         $week = ($week=='week');
  32.         $program $this->model->getProgramEvents($id$week);
  33.         return $this->render('/partials/program.html.twig', [
  34.             'program' => $program,
  35.             'eid' => System::encrypt($id)
  36.         ]);
  37.     }
  38.     /**
  39.      * @Route("/program-divadlo-html-{id}", methods={"GET"})
  40.      * @Route("/program-divadlo-html-{id}/{week}", methods={"GET"})
  41.      * @return Response
  42.      */
  43.     public function programDivadloData($idstring $week ''):Response
  44.     {
  45.         $week = ($week=='week');
  46.         $program $this->model->getProgramEvents($id$week);
  47.         return $this->render('/partials/program_divadlo.html.twig', [
  48.             'program' => $program,
  49.             'eid' => System::encrypt($id)
  50.         ]);
  51.     }
  52.     /**
  53.      * @Route("/program")
  54.      * @Route("/program-{eid}", methods={"GET"})
  55.      * @return Response
  56.      */
  57.     public function program(string $eid ''): Response
  58.     {
  59.         //$link = $this->request->getRequestUri();
  60.         $page $this->model->getProgramInfo();
  61.         $id 0;
  62.         if ($eid!=='') {
  63.             $id = (int)System::decrypt($eid);
  64.         }
  65.         return $this->render('/pages/program.html.twig', [
  66.             'pageinfo' => $this->pageInfo,
  67.             'page' => $page,
  68.             'id' => $id
  69.         ]);
  70.     }
  71. }
  72. ?>