<?php
namespace App\Controller;
use App\Repository\InstallsReleasesRepository;
use App\Repository\InstallsRepository;
use App\Repository\McamVersionRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class DownloadsController extends AbstractController
{
#[Route('/downloads', name: 'downloads')]
public function index(
McamVersionRepository $versionsRepository,
InstallsRepository $installsRepository,
InstallsReleasesRepository $installsReleasesRepository
): Response {
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
return $this->render('downloads/index.html.twig', [
'versions' => $versionsRepository->lastFour(),
'installs' => $installsRepository->all(),
'releases' => $installsReleasesRepository->all(),
'betas' => 0,
]);
}
#[Route('/downloads/betas', name: 'betas')]
public function betas(
McamVersionRepository $versionsRepository,
InstallsRepository $installsRepository,
InstallsReleasesRepository $installsReleasesRepository
): Response {
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
return $this->render('downloads/index.html.twig', [
'versions' => $versionsRepository->lastFour(),
'installs' => $installsRepository->all(),
'releases' => $installsReleasesRepository->allBetas(),
'betas' => 1,
]);
}
}