src/Controller/TeamController.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Product;
  4. use App\Entity\Team;
  5. use Doctrine\ORM\EntityManagerInterface;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  9. class TeamController extends AbstractController
  10. {
  11.     private $entityManager;
  12.     public function __construct(EntityManagerInterface $entityManager){
  13.        $this->entityManager $entityManager;
  14.     }
  15.     #[Route('/qui-suis-je'name'app_team')]
  16.     public function index(): Response
  17.     {
  18.         $teams $this->entityManager->getRepository(Team::class)->findAll();
  19.         $activity $this->entityManager->getRepository(Product::class)->findAll();
  20.         return $this->render('team/index.html.twig',[
  21.             'teams' => $teams,
  22.             'activity' => $activity,
  23.         ] );
  24.     }
  25. }