src/Controller/VisionMissionController.php line 20

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({
  13.      *     "en": "/vision-mission",
  14.      *     "tr": "/vizyon-misyon"
  15.      * }, name="vision_mission")
  16.      */
  17.     public function index(Request $requestPageRepository $repository): Response
  18.     {
  19.         /** @var Page $page */
  20.         $page $repository->findOneBy([
  21.             'name' => 'vision-mission',
  22.             'locale' => $request->getLocale(),
  23.         ]);
  24.         return $this->render('vision_mission/index.html.twig', [
  25.             'content' => $page->getContent(),
  26.         ]);
  27.     }
  28. }