MainController.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Attribute\Route;
  6. final class MainController extends AbstractController
  7. {
  8. #[Route('/', name: 'app_main')]
  9. public function index(): Response
  10. {
  11. return $this->render('main/index.html.twig', [
  12. 'controller_name' => 'MainController',
  13. ]);
  14. }
  15. #[Route('/charte-animations', name: 'app_code_of_conduct')]
  16. public function codeOfConduct(): Response
  17. {
  18. // Lire le contenu de la charte des animations depuis un fichier
  19. $codeContent = file_get_contents(__DIR__ . '/../../public/pages/code.md');
  20. return $this->render('main/markdown.html.twig', [
  21. 'codeContent' => $codeContent,
  22. ]);
  23. }
  24. #[Route('/cgu', name: 'app_terms')]
  25. public function terms(): Response
  26. {
  27. // Lire le contenu de la charte des animations depuis un fichier
  28. $codeContent = file_get_contents(__DIR__ . '/../../public/pages/terms.md');
  29. return $this->render('main/markdown.html.twig', [
  30. 'codeContent' => $codeContent,
  31. ]);
  32. }
  33. #[Route('/legal', name: 'app_legal')]
  34. public function legal(): Response
  35. {
  36. // Lire le contenu de la charte des animations depuis un fichier
  37. $codeContent = file_get_contents(__DIR__ . '/../../public/pages/legal.md');
  38. return $this->render('main/markdown.html.twig', [
  39. 'codeContent' => $codeContent,
  40. ]);
  41. }
  42. #[Route('/contact', name: 'app_contact')]
  43. public function contact(): Response
  44. {
  45. // Lire le contenu de la charte des animations depuis un fichier
  46. $codeContent = file_get_contents(__DIR__ . '/../../public/pages/legal.md');
  47. return $this->render('main/markdown.html.twig', [
  48. 'codeContent' => $codeContent,
  49. ]);
  50. }
  51. }