<?php
namespace App\Controller;
use App\Repository\BienRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class CoupcoeurController extends AbstractController
{
/**
* @Route("/coup-de-coeur", name="app_coupcoeur")
*/
public function index(
BienRepository $bienRepository
): Response
{
return $this->render('coupcoeur/index.html.twig', [
'biens' => $bienRepository->findBy(['coupCoeur' => 'OUI'], ['id' => 'DESC'])
]);
}
}