src/Controller/MainController.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\PageRepository;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class MainController extends AbstractController
  8. {
  9.     #[Route('/{path}'name'main'requirements: ['path' => '^(?!_|api|account|admin\/).*'])]
  10.     public function index(PageRepository $repo): Response
  11.     {
  12.         $page $repo->findOneBy(['uid' => 'main']);
  13.         return $this->render('main/index.html.twig', [
  14.             'page' => $page,
  15.         ]);
  16.     }
  17. }