src/Controller/AccountController.php line 22

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