Aucun article trouvé.
Ceci est une application de gestion de projets.
Elle permet de :
Cliquez sur ce bouton pour voir le code source du contrôleur et du template utilisé pour afficher cette page.
/**
* @Route("/", defaults={"page": "1", "_format"="html"}, methods={"GET"}, name="blog_index")
* @Route("/rss.xml", defaults={"page": "1", "_format"="xml"}, methods={"GET"}, name="blog_rss")
* @Route("/page/{page<[1-9]\d*>}", defaults={"_format"="html"}, methods={"GET"}, name="blog_index_paginated")
* @Cache(smaxage="10")
*
* NOTE: For standard formats, Symfony will also automatically choose the best
* Content-Type header for the response.
* See https://symfony.com/doc/current/quick_tour/the_controller.html#using-formats
*/
public function index(Request $request, int $page, string $_format, PostRepository $posts, TagRepository $tags): Response
{
$tag = null;
if ($request->query->has('tag')) {
$tag = $tags->findOneBy(['name' => $request->query->get('tag')]);
}
$latestPosts = $posts->findLatest($page, $tag);
// Every template name also has two extensions that specify the format and
// engine for that template.
// See https://symfony.com/doc/current/templating.html#template-suffix
return $this->render('blog/index.'.$_format.'.twig', ['posts' => $latestPosts]);
}