src/Controller/DownloadsController.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\InstallsReleasesRepository;
  4. use App\Repository\InstallsRepository;
  5. use App\Repository\McamVersionRepository;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class DownloadsController extends AbstractController
  10. {
  11.     #[Route('/downloads'name'downloads')]
  12.     public function index(
  13.         McamVersionRepository $versionsRepository,
  14.         InstallsRepository $installsRepository,
  15.         InstallsReleasesRepository $installsReleasesRepository
  16.     ): Response {
  17.         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
  18.         return $this->render('downloads/index.html.twig', [
  19.             'versions' => $versionsRepository->lastFour(),
  20.             'installs' => $installsRepository->all(),
  21.             'releases' => $installsReleasesRepository->all(),
  22.             'betas' => 0,
  23.         ]);
  24.     }
  25.     #[Route('/downloads/betas'name'betas')]
  26.     public function betas(
  27.         McamVersionRepository $versionsRepository,
  28.         InstallsRepository $installsRepository,
  29.         InstallsReleasesRepository $installsReleasesRepository
  30.     ): Response {
  31.         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
  32.         return $this->render('downloads/index.html.twig', [
  33.             'versions' => $versionsRepository->lastFour(),
  34.             'installs' => $installsRepository->all(),
  35.             'releases' => $installsReleasesRepository->allBetas(),
  36.             'betas' => 1,
  37.         ]);
  38.     }
  39. }