src/Controller/VisionMissionController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Main\Page;
  4. use App\Repository\Main\PageRepository;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class VisionMissionController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/vizyon-misyon", name="vision_mission")
  13.      */
  14.     public function index(Request $requestPageRepository $repository): Response
  15.     {
  16.         /** @var Page $page */
  17.         $page $repository->findOneBy([
  18.             'name' => 'vision-mission',
  19.             'locale' => $request->getLocale(),
  20.         ]);
  21.         return $this->render('vision_mission/index.html.twig', [
  22.             'content' => $page->getContent(),
  23.         ]);
  24.     }
  25. }