src/Controller/HomepageController.php line 22
<?phpnamespace App\Controller;use App\Entity\Category;use App\Entity\Page;use App\Entity\WarEvent;use Doctrine\ORM\EntityManagerInterface;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;class HomepageController extends AbstractController{#[Route(path: '/{_locale<%app.supported_locales%>}',name: 'app_homepage',defaults: ['_locale' => '%app.default_locale%'])]public function index(EntityManagerInterface $em, string $_locale): Response{$pageRepo = $em->getRepository(Page::class);$intro = $pageRepo->findOneBy(['slug' => 'intro']);$about = $pageRepo->findOneBy(['slug' => 'about']);$categories = $em->getRepository(Category::class)->findBy([], ['weight' => 'ASC']);return $this->render('homepage/index.html.twig', ['intro' => $intro->isVisible() ? $intro : null,'about' => $about->isVisible() ? $about : null,'categories' => $categories,]);}}