src/Controller/PageController.php line 55

  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Package;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class PageController extends BaseController
  9. {
  10.     #[Route(''name'page_index')]
  11.     public function index()
  12.     {
  13.         $packages $this->entityManager->getRepository(Package::class)->findAll();
  14.         return $this->render('@web/page/index.html.twig',[
  15.             'packages' => $packages
  16.         ]);
  17.     }
  18.     #[Route('/indexes/test-selection'name'page_test_selection'methods: ['GET'])]
  19.     public function page_test_selection()
  20.     {
  21.         return $this->render('@web/page/indexes/test-selection.html.twig',[
  22.         ]);
  23.     }
  24.     #[Route('/indexes/test-sat-selection'name'page_test_sat_selection'methods: ['GET'])]
  25.     public function page_test_sat_selection()
  26.     {
  27.         return $this->render('@web/page/indexes/test-sat-selection.html.twig',[
  28.         ]);
  29.     }
  30.     #[Route('/indexes/reviews'name'page_reviews'methods: ['GET'])]
  31.     public function page_reviews()
  32.     {
  33.         return $this->render('@web/page/indexes/reviews.html.twig',[
  34.         ]);
  35.     }
  36.     #[Route('/indexes/support'name'page_support'methods: ['GET'])]
  37.     public function page_support()
  38.     {
  39.         return $this->render('@web/page/indexes/support.html.twig',[
  40.         ]);
  41.     }
  42.     #[Route('/indexes/results'name'page_result'methods: ['GET'])]
  43.     public function page_result()
  44.     {
  45.         return $this->render('@web/page/indexes/result.html.twig',[
  46.         ]);
  47.     }
  48.     #[Route('/indexes/results-sat'name'page_result_sat'methods: ['GET'])]
  49.     public function page_result_sat()
  50.     {
  51.         return $this->render('@web/page/indexes/result-sat.html.twig',[
  52.         ]);
  53.     }
  54.     #[Route('/indexes/section-selection'name'page_section_selection'methods: ['GET'])]
  55.     public function page_section_selection(Request $request)
  56.     {
  57.         $type $request->query->get('exam');
  58.         if (empty($type)) {
  59.             $type $request->query->get('type');
  60.         }
  61.         $test $request->query->get('test');
  62.         if (!$this->hasAccess($type$test)) {
  63.             return $this->redirect('/#pricing');
  64.         }
  65.         return $this->render('@web/page/indexes/section-selection.html.twig');
  66.     }
  67.     #[Route('/indexes/section-sat-selection'name'page_section_sat_selection'methods: ['GET'])]
  68.     public function page_section_sat_selection(Request $request)
  69.     {
  70.         $type $request->query->get('exam');
  71.         if (empty($type)) {
  72.             $type $request->query->get('type');
  73.         }
  74.         $test $request->query->get('test');
  75.         if (!$this->hasAccess($type$test)) {
  76.             return $this->redirect('/#pricing');
  77.         }
  78.         return $this->render('@web/page/indexes/section-sat-selection.html.twig',[
  79.         ]);
  80.     }
  81.     #[Route('/indexes/speaking'name'page_speaking'methods: ['GET'])]
  82.     public function page_speaking()
  83.     {
  84.         return $this->render('@web/page/indexes/speaking.html.twig',[
  85.         ]);
  86.     }
  87.     #[Route('/indexes/speaking2026'name'page_speaking2026'methods: ['GET'])]
  88.     public function page_speaking2026()
  89.     {
  90.         return $this->render('@web/page/indexes/speaking2026.html.twig',[
  91.         ]);
  92.     }
  93.     #[Route('/indexes/reading'name'page_reading'methods: ['GET'])]
  94.     public function page_reading()
  95.     {
  96.         return $this->render('@web/page/indexes/reading.html.twig',[
  97.         ]);
  98.     }
  99.     #[Route('/indexes/reading2026'name'page_reading2026'methods: ['GET'])]
  100.     public function page_reading2026()
  101.     {
  102.         return $this->render('@web/page/indexes/reading2026.html.twig',[
  103.         ]);
  104.     }
  105.     #[Route('/indexes/listening'name'page_listening'methods: ['GET'])]
  106.     public function page_listening()
  107.     {
  108.         return $this->render('@web/page/indexes/listening.html.twig',[
  109.         ]);
  110.     }
  111.     #[Route('/indexes/listening2026'name'page_listening2026'methods: ['GET'])]
  112.     public function page_listening2026()
  113.     {
  114.         return $this->render('@web/page/indexes/listening2026.html.twig',[
  115.         ]);
  116.     }
  117.     #[Route('/indexes/writing'name'page_writing'methods: ['GET'])]
  118.     public function page_writing()
  119.     {
  120.         return $this->render('@web/page/indexes/writing.html.twig',[
  121.         ]);
  122.     }
  123.     #[Route('/indexes/writing2026'name'page_writing2026'methods: ['GET'])]
  124.     public function page_writing2026()
  125.     {
  126.         return $this->render('@web/page/indexes/writing2026.html.twig',[
  127.         ]);
  128.     }
  129.     #[Route('/indexes/math'name'page_math'methods: ['GET'])]
  130.     public function page_math()
  131.     {
  132.         return $this->render('@web/page/indexes/math.html.twig',[
  133.         ]);
  134.     }
  135.     #[Route('/indexes/act'name'page_act'methods: ['GET'])]
  136.     public function page_act()
  137.     {
  138.         return $this->render('@web/page/indexes/act.html.twig',[
  139.         ]);
  140.     }
  141.     #[Route('/indexes/account'name'page_account'methods: ['GET'])]
  142.     public function page_account()
  143.     {
  144. //        dump($this->getUser());
  145. //        die;
  146.         if (!$this->getUser()){
  147.             return $this->redirectToRoute('app_login');
  148.         }
  149.         return $this->render('@web/page/indexes/account.html.twig',[
  150.         ]);
  151.     }
  152. }