<?php
namespace App\Controller;
use App\Features\RecruitmentCampaign\Usecase\GetRecruitmentCampaignList;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
class DefaultController extends AbstractController
{
public function __construct(private ManagerRegistry $registry){}
/**
* @Route("/", name="home")
* @return Response
*/
public function index(GetRecruitmentCampaignList $getRecruitmentCampaign)
{
return $this->render('home.html.twig', ['campaigns' => $getRecruitmentCampaign->execute([])]);
}
/**
* @Route("/a-propos", name="about")
* @return Response
*/
public function about(TranslatorInterface $translator)
{
return $this->render('about.html.twig', ["title" => $translator->trans("about")]);
}
/**
* @Route("/sitemap.xml", name="sitemap", defaults={"xml"=true, "_format"="xml"})
*/
public function menu($activeMenu = null, $isFooter = false, $xml = false): Response
{
return $this->render($xml ? 'Default/sitemap.xml.twig' : ($isFooter ? 'Default/footer.html.twig' : 'Default/menu.html.twig'),[
'activeMenu'=>$activeMenu,
]);
}
}