src/Controller/HomeController.php line 20

Open in your IDE?
  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. use Symfony\Component\HttpFoundation\Request;
  7. use Twig\Environment;
  8. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  9. class HomeController extends AbstractController
  10. {
  11.     public function __construct(Environment $twig)
  12.     {
  13.         $this->loader = $twig->getLoader();
  14.     }
  15.     #[Route('/', name: 'app_home')]
  16.     public function index(): Response
  17.     {
  18.         return $this->redirectToRoute('app_meeting_index');
  19.     }
  20. //    #[Route('/{path}')]
  21. //    public function root($path)
  22. //    {
  23. //        if ($this->loader->exists($path.'.html.twig')) {
  24. //            if ($path == '/' || $path == 'home') {
  25. //                die('Home');
  26. //            }
  27. //            return $this->render($path.'.html.twig');
  28. //        }
  29. //        throw $this->createNotFoundException();
  30. //    }
  31. }