<?php
namespace App\Controller\Site;
use App\Controller\BaseController;
use App\Entity\FluxRss;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class FluxRssController extends BaseController
{
/**
* @Route("/rss.{_format}", defaults={"_format"="xml"}, requirements={"_format"="xml"}))
*/
public function index(): Response
{
$em = $this->getDoctrine()->getManager();
$feeds = $em->getRepository(FluxRss::class)->findBy([],['created_at'=>'DESC']);
return $this->render('site/flux_rss/index.xml.twig', [
'feeds' => $feeds,
]);
}
/**
* @Route("/feeds/{id}", name="site_flux.show"))
*/
public function show(FluxRss $feed)
{
return $this->render('site/flux_rss/show.html.twig', [
'feed' => $feed,
]);
}
/**
* @Route("/rss/reader", name="site_flux.reader"))
*/
public function installReader()
{
return $this->render('site/flux_rss/reader.html.twig', [
]);
}
}