src/Front/Controller/IndexController.php line 19
<?php
namespace App\Front\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\PageRepository;
use App\Util\LanguageUtil;
class IndexController extends AbstractController
{
#[Route(path: [
'pl' => '/',
'en' => '/'
], name: 'index', priority: 10)]
public function index(Request $request, PageRepository $pageRepository): Response
{
$lang = LanguageUtil::getLanguage($request->getLocale());
$entity = $pageRepository->findOneByIdName('home', $lang);
return $this->render('@front_templates/Index/index.html.twig', [
'entity' => $entity
]);
}
}