src/Controller/HomeController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\ArticleRepository;
  4. use App\Repository\PriceRepository;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class HomeController extends AbstractController
  9. {
  10.     #[Route('/'name'app_home')]
  11.     public function index(ArticleRepository $articleRepositoryPriceRepository $priceRepository): Response
  12.     {
  13.         return $this->render('home/index.html.twig', [
  14.             'articlesPresentation' => $articleRepository->findby([
  15.                 'isPublish' => true,
  16.                 ],[
  17.                     'ranking' => 'ASC'
  18.                 ]),
  19.             'prices' => $priceRepository->findby([
  20.                 'isPublish' => true,
  21.                 ],[
  22.                     'id' => 'ASC'
  23.                 ]),
  24.         ]);
  25.     }
  26. }