<?php
namespace App\Controller;
use App\Entity\Product;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
class AccountController extends AbstractController
{
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
#[Route('/compte', name: 'app_account')]
public function index(): Response
{
$activity = $this->entityManager->getRepository(Product::class)->findAll();
return $this->render('account/index.html.twig', [
'activity' => $activity
]);
}
}