src/Controller/Front/AboutController.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Entity\{AboutUsWhyChooseUsTeam};
  4. use App\Form\AboutUsType;
  5. use App\Service\AccessClientService;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. use Doctrine\ORM\EntityManagerInterface;
  11. class AboutController extends AbstractController
  12. {
  13.     /**
  14.      * @Route("/about/{slug}", name="app_front_about")
  15.      */
  16.     public function about(AccessClientService $accessClientServiceAboutUs $aboutUsEntityManagerInterface $entityManager): Response
  17.     {
  18.         $accessClientService->handleAccessControl();
  19.         $page $entityManager->getRepository(AboutUs::class)->findOneBySlug($aboutUs->getSlug());
  20.         $whyChooseUs $entityManager->getRepository(WhyChooseUs::class)->findOneBy([], ['id' => 'DESC']);
  21.         $team $entityManager->getRepository(Team::class)->findBy([], ['id' => 'ASC']);
  22.         return $this->render('front/about/about.html.twig', [
  23.             'page' => $page,
  24.             'whyChooseUs' => $whyChooseUs,
  25.             'team' => $team
  26.         ]);
  27.     }
  28. }