<?php
namespace App\Controller;
use App\Entity\Article;
use App\Form\ArticleType;
use App\Repository\ArticleRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
#[Route('/showactu')]
class ArticleShowController extends AbstractController
{
public function __construct(private UrlGeneratorInterface $urlGenerator)
{
}
#[Route('/', name: 'app_article_show_index', methods: ['GET'])]
public function index(ArticleRepository $articleRepository): Response
{
return $this->render('article/indexshow.html.twig', [
'articles' => $articleRepository->findAll(),
]);
}
#[Route('/{id}', name: 'app_article_show', methods: ['GET'])]
public function show(Article $article): Response
{
return $this->render('article/show.html.twig', [
'article' => $article,
]);
}
}