src/Controller/Bo/HomeController.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Bo;
  3. use App\Repository\ClubRepository;
  4. use App\Service\ClubHandler;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. #[Route('/bo'name'bo_')]
  9. class HomeController extends AbstractController
  10. {
  11.     public function __construct(
  12.         private readonly ClubHandler $clubHandler
  13.     )
  14.     {
  15.     }
  16.     #[Route('/'name'home')]
  17.     public function home(ClubRepository $clubRepository): Response
  18.     {
  19.         $club $this->clubHandler->getCurrentBoClub();
  20.         $statistics $clubRepository->getStatistics($club);
  21.         return $this->render('bo/home/home.html.twig', [
  22.             'club' => $club,
  23.             'statistics' => $statistics
  24.         ]);
  25.     }
  26. }