<?php
namespace App\Controller;
use App\Repository\ArticleRepository;
use App\Repository\PriceRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class HomeController extends AbstractController
{
#[Route('/', name: 'app_home')]
public function index(ArticleRepository $articleRepository, PriceRepository $priceRepository): Response
{
return $this->render('home/index.html.twig', [
'articlesPresentation' => $articleRepository->findby([
'isPublish' => true,
],[
'ranking' => 'ASC'
]),
'prices' => $priceRepository->findby([
'isPublish' => true,
],[
'id' => 'ASC'
]),
]);
}
}