src\Controller\Site\FluxRssController.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Site;
  3. use App\Controller\BaseController;
  4. use App\Entity\FluxRss;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class FluxRssController extends BaseController
  9. {
  10.     /**
  11.      * @Route("/rss.{_format}", defaults={"_format"="xml"}, requirements={"_format"="xml"}))
  12.      */
  13.     public function index(): Response
  14.     {
  15.         $em $this->getDoctrine()->getManager();
  16.         $feeds $em->getRepository(FluxRss::class)->findBy([],['created_at'=>'DESC']);
  17.         return $this->render('site/flux_rss/index.xml.twig', [
  18.             'feeds' => $feeds,
  19.         ]);
  20.     }
  21.     /**
  22.      * @Route("/feeds/{id}", name="site_flux.show"))
  23.      */
  24.     public function show(FluxRss $feed)
  25.     {
  26.         return $this->render('site/flux_rss/show.html.twig', [
  27.             'feed' => $feed,
  28.         ]);
  29.     }
  30.     /**
  31.      * @Route("/rss/reader", name="site_flux.reader"))
  32.      */
  33.     public function installReader()
  34.     {
  35.         return $this->render('site/flux_rss/reader.html.twig', [
  36.         ]);
  37.     }
  38. }