src/Controller/Frontend/PageController.php line 104

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Frontend;
  3. use App\Application\Content\ContentFrontendData;
  4. use App\Application\Content\ContentService;
  5. use App\Application\Redaktor\RedaktorFrontendData;
  6. use App\Application\Redaktor\RedaktorService;
  7. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
  8. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  9. use Symfony\Component\HttpFoundation\RedirectResponse;
  10. use Symfony\Component\HttpFoundation\Response;
  11. use Symfony\Component\Routing\Annotation\Route;
  12. #[Cache(expires: '+10 minutes')]
  13. class PageController extends AbstractController
  14. {
  15. #[Route(path: '/redaktion', name: 'fe.page_redaktion')]
  16. public function redaktion(ContentService $contentService, RedaktorService $redaktorService): Response
  17. {
  18. $content = $contentService->getContentByCode('REDAKTION', new ContentFrontendData(), true);
  19. $redaktoren = $redaktorService->findAllShowOnFrontend(new RedaktorFrontendData());
  20. return $this->render('frontend/page/redaktion.html.twig', [
  21. 'content' => $content,
  22. 'redaktoren' => $redaktoren,
  23. ]);
  24. }
  25. #[Route(path: '/impressum', name: 'fe.page_impressum')]
  26. #[Route(path: '/impressum.html', defaults: ['legacyUrl' => true])]
  27. public function impressum(ContentService $contentService, $legacyUrl = false): RedirectResponse|Response
  28. {
  29. // datenschutz.html benötigt für UW-APP, soll dann aber direkt redirected werden
  30. if ($legacyUrl) {
  31. return $this->redirectToRoute('fe.page_impressum', [], 301);
  32. }
  33. $content = $contentService->getContentByCode('IMPRESSUM', new ContentFrontendData(), true);
  34. return $this->render('frontend/page/page-template.html.twig', [
  35. 'h1_title' => 'Impressum',
  36. 'content' => $content,
  37. ]);
  38. }
  39. #[Route(path: '/datenschutz', name: 'fe.page_datenschutz')]
  40. #[Route(path: '/datenschutz.html', defaults: ['legacyUrl' => true])]
  41. public function datenschutz(ContentService $contentService, $legacyUrl = false): RedirectResponse|Response
  42. {
  43. // datenschutz.html benötigt für UW-APP, soll dann aber direkt redirected werden
  44. if ($legacyUrl) {
  45. return $this->redirectToRoute('fe.page_datenschutz', [], 301);
  46. }
  47. $content = $contentService->getContentByCode('DATENSCHUTZ', new ContentFrontendData(), true);
  48. return $this->render('frontend/page/page-template.html.twig', [
  49. 'h1_title' => 'Datenschutz',
  50. 'content' => $content,
  51. ]);
  52. }
  53. #[Route(path: '/disclaimer', name: 'fe.page_disclaimer')]
  54. #[Route(path: '/disclaimer.html', defaults: ['legacyUrl' => true])]
  55. public function disclaimer(ContentService $contentService, $legacyUrl = false): RedirectResponse|Response
  56. {
  57. // disclaimer.html benötigt für UW-APP, soll dann aber direkt redirected werden
  58. if ($legacyUrl) {
  59. return $this->redirectToRoute('fe.page_disclaimer', [], 301);
  60. }
  61. $content = $contentService->getContentByCode('DISCLAIMER', new ContentFrontendData(), true);
  62. return $this->render('frontend/page/page-template.html.twig', [
  63. 'h1_title' => 'Disclaimer',
  64. 'content' => $content,
  65. ]);
  66. }
  67. #[Route(path: '/inserieren', name: 'fe.page_inserieren')]
  68. public function werbung(ContentService $contentService): Response
  69. {
  70. $content = $contentService->getContentByCode('INSERIEREN', new ContentFrontendData(), true);
  71. return $this->render('frontend/page/page-template.html.twig', [
  72. 'h1_title' => 'Inserieren',
  73. 'content' => $content,
  74. ]);
  75. }
  76. #[Route(path: '/uw-app', name: 'fe.page_uwapp')]
  77. public function epaperUWApp(ContentService $contentService): Response
  78. {
  79. $content = $contentService->getContentByCode('UW-APP', new ContentFrontendData(), true);
  80. return $this->render('frontend/page/page-template.html.twig', [
  81. 'h1_title' => 'UW-App',
  82. 'content' => $content,
  83. ]);
  84. }
  85. #[Route(path: '/todesanzeigen', name: 'fe.page_todesanzeigen')]
  86. public function todesanzeigen(ContentService $contentService): Response
  87. {
  88. $content = $contentService->getContentByCode('TODESANZEIGEN', new ContentFrontendData(), true);
  89. return $this->render('frontend/page/page-template.html.twig', [
  90. 'h1_title' => 'Todesanzeigen',
  91. 'content' => $content,
  92. ]);
  93. }
  94. #[Route(path: '/faq', name: 'fe.page_faq')]
  95. public function faq(ContentService $contentService): Response
  96. {
  97. $content = $contentService->getContentByCode('ACCORDION_FAQ', new ContentFrontendData(), true);
  98. return $this->render('frontend/page/page-template.html.twig', [
  99. 'h1_title' => 'FAQ',
  100. 'content' => $content,
  101. ]);
  102. }
  103. }