|
@@ -5,6 +5,7 @@ namespace App\Controller;
|
|
use App\Entity\Article;
|
|
use App\Entity\Article;
|
|
use App\Form\ArticleType;
|
|
use App\Form\ArticleType;
|
|
use App\Repository\ArticleRepository;
|
|
use App\Repository\ArticleRepository;
|
|
|
|
+use Doctrine\Common\Collections\Order;
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\DependencyInjection\Attribute\Target;
|
|
use Symfony\Component\DependencyInjection\Attribute\Target;
|
|
@@ -22,7 +23,7 @@ final class ArticleController extends AbstractController
|
|
public function index(ArticleRepository $articleRepository): Response
|
|
public function index(ArticleRepository $articleRepository): Response
|
|
{
|
|
{
|
|
return $this->render('article/index.html.twig', [
|
|
return $this->render('article/index.html.twig', [
|
|
- 'articles' => $articleRepository->findAll(),
|
|
|
|
|
|
+ 'articles' => $articleRepository->findBy(criteria: [], orderBy: ['publicationDate' => 'DESC']),
|
|
]);
|
|
]);
|
|
}
|
|
}
|
|
|
|
|