src/Controller/HomeController.php line 18

  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. class HomeController extends AbstractController
  7. {
  8.     #[Route('/')]
  9.     public function indexNoLocale(): Response
  10.     {        
  11.         return $this->redirectToRoute('app_home', ['_locale' => 'fr']);
  12.     }
  13.     #[Route('/{_locale<%app.supported_locales%>}/'name'app_home'options: ['sitemap' => true])]
  14.     public function index(): Response
  15.     {
  16.         return $this->render('home/index.html.twig', [
  17.             'active_menu' => 'home'
  18.         ]);
  19.     }
  20. }
  21.