src/Controller/PresentationController.php line 22

  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use App\Repository\PresentationTexteRepository;
  8. class PresentationController extends AbstractController
  9. {
  10.     public function __construct(private PresentationTexteRepository $presentationTexteRepository)
  11.     {
  12.     }
  13.     #[\Symfony\Component\Routing\Attribute\Route(path'/presentation'name'presentation')]
  14.     public function presentation(): Response
  15.     {
  16.         $text $this->presentationTexteRepository->find(1);
  17.         return $this->render('presentation/presentation.html.twig', [
  18.             'controller_name' => 'PresentationController',
  19.             'active_menu' => 'presentation',
  20.             'text' => $text,
  21.         ]);
  22.     }
  23.     #[\Symfony\Component\Routing\Attribute\Route(path'/newsletter'name'newsletter')]
  24.     public function newsletter():Response
  25.     {
  26.         return $this->render('presentation/newsletter.html.twig', [
  27.             'controller_name' => 'NewsletterController',
  28.             'active_menu' => 'newsletter',
  29.         ]);
  30.     }
  31. }