src/Controller/user/AccueilController.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Controller\user;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use App\Repository\PostRepository;
  7. use App\Repository\ActualiteRepository;
  8. class AccueilController extends AbstractController
  9. {
  10.     #[Route('/'name'app_accueil')]
  11.     public function index(PostRepository $postRepoActualiteRepository $actRepo): Response
  12.     {
  13.         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
  14.         return $this->render('user/accueil/index.html.twig', [
  15.             'controller_name' => 'AccueilController',
  16.             'findAllPost' => $postRepo->findBy([], ['id' => 'ASC']),
  17.             'findAllAct' => $actRepo->findBy([], ['id' => 'DESC']),
  18.         ]);
  19.     }
  20. }