Explorar el Código

Correction ordre descendant pour les articles

Sangfroid hace 2 meses
padre
commit
a167091627
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/Controller/IndexController.php

+ 1 - 1
src/Controller/IndexController.php

@@ -12,7 +12,7 @@ class IndexController extends AbstractController
     #[Route('/', name: 'app_index')]
     public function index(ArticleRepository $articleRepository): Response
     {
-        $articles = $articleRepository->findBy(['state' => 'published']);
+        $articles = $articleRepository->findBy(criteria: ['state' => 'published'], orderBy: ['publicationDate' => 'DESC']);
 
         return $this->render('index/index.html.twig', [
             'articles'  => $articles