src/Controller/AboutController.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\About;
  4. use App\Repository\AboutRepository;
  5. use Doctrine\ORM\EntityManagerInterface;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class AboutController extends AbstractController {
  10.     private $entityManager;
  11.     public function __construct(EntityManagerInterface $entityManager, AboutRepository $aboutRepo) {
  12.         $this->entityManager = $entityManager;
  13.         $this->aboutRepo = $aboutRepo;
  14.     }
  15.     /**
  16.      * @Route("/connaitre-l-academie", name="app_about")
  17.      */
  18.     public function index(): Response {
  19.         $about = $this->entityManager->getRepository(About::class)->findByIsActive(1);
  20.         return $this->render('about/index.html.twig', [
  21.                     'abouts' => $about,
  22.         ]);
  23.     }
  24. //    
  25. //     /**
  26. //     * @Route("/{slug}", name="show_about")
  27. //     */
  28. //    public function view($slug): Response {
  29. //        $showabout = $this->entityManager->getRepository(About::class)->findOneBySlug($slug);
  30. //
  31. //        return $this->render('about/show.html.twig', [
  32. //                    'aboutview' => $showabout,
  33. //        ]);
  34. //    }
  35. }