src/Controller/InformationSocietyController.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 InformationSocietyController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/bilgi-toplumu-hizmetleri", name="information_society")
  13.      */
  14.     public function index(Request $requestPageRepository $repository): Response
  15.     {
  16.         /** @var Page $page */
  17.         $page $repository->findOneBy([
  18.             'locale' => $request->getLocale(),
  19.             'name' => 'information-society',
  20.         ]);
  21.         return $this->render('information_society/index.html.twig', [
  22.             'content' => $page->getContent(),
  23.         ]);
  24.     }
  25. }