<?php
namespace App\Controller;
use App\Entity\About;
use App\Repository\AboutRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class AboutController extends AbstractController {
private $entityManager;
public function __construct(EntityManagerInterface $entityManager, AboutRepository $aboutRepo) {
$this->entityManager = $entityManager;
$this->aboutRepo = $aboutRepo;
}
/**
* @Route("/connaitre-l-academie", name="app_about")
*/
public function index(): Response {
$about = $this->entityManager->getRepository(About::class)->findByIsActive(1);
return $this->render('about/index.html.twig', [
'abouts' => $about,
]);
}
//
// /**
// * @Route("/{slug}", name="show_about")
// */
// public function view($slug): Response {
// $showabout = $this->entityManager->getRepository(About::class)->findOneBySlug($slug);
//
// return $this->render('about/show.html.twig', [
// 'aboutview' => $showabout,
// ]);
// }
}