<?php
namespace App\Controller\Front;
use App\Entity\{AboutUs, WhyChooseUs, Team};
use App\Form\AboutUsType;
use App\Service\AccessClientService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
class AboutController extends AbstractController
{
/**
* @Route("/about/{slug}", name="app_front_about")
*/
public function about(AccessClientService $accessClientService, AboutUs $aboutUs, EntityManagerInterface $entityManager): Response
{
$accessClientService->handleAccessControl();
$page = $entityManager->getRepository(AboutUs::class)->findOneBySlug($aboutUs->getSlug());
$whyChooseUs = $entityManager->getRepository(WhyChooseUs::class)->findOneBy([], ['id' => 'DESC']);
$team = $entityManager->getRepository(Team::class)->findBy([], ['id' => 'ASC']);
return $this->render('front/about/about.html.twig', [
'page' => $page,
'whyChooseUs' => $whyChooseUs,
'team' => $team
]);
}
}