<?php
namespace App\Controller\Bo;
use App\Repository\ClubRepository;
use App\Service\ClubHandler;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[Route('/bo', name: 'bo_')]
class HomeController extends AbstractController
{
public function __construct(
private readonly ClubHandler $clubHandler
)
{
}
#[Route('/', name: 'home')]
public function home(ClubRepository $clubRepository): Response
{
$club = $this->clubHandler->getCurrentBoClub();
$statistics = $clubRepository->getStatistics($club);
return $this->render('bo/home/home.html.twig', [
'club' => $club,
'statistics' => $statistics
]);
}
}