src/Controller/HomeController.php line 17
<?phpnamespace App\Controller;use App\Repository\CategoriesRepository;use App\Repository\DifficultesRepository;use App\Repository\ProjetsRepository;use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\Serializer\SerializerInterface;class HomeController extends AbstractController{#[Route('/', name: 'app_home')]public function index(ProjetsRepository $projetsRepository, DifficultesRepository $difficultesRepository, CategoriesRepository $categoriesRepository): Response{$projects = $projetsRepository->renderForJs();$difficulties = $difficultesRepository->renderForJs();$categories = $categoriesRepository->renderForJs();if (!$projects) {throw $this->createNotFoundException('Pas de projet avec cette description');}return $this->render('index.html.twig', ['controller_name' => 'HomeController','projects' => $projects,'difficulties' => $difficulties,'categories' => $categories,]);}}