Era brevis ratione est
Diatrias tolerare tanquam noster caesium. Ut suscipit posuere justo at vulputate. Sunt accentores vitare salvus flavum parses. Ubi est audax amicitia. Morbi tempus commodo mattis. Abnobas sunt hilotaes de placidus vita.
Choose your language
16 novembre 2023 09:34:15 Tom Doe
Diatrias tolerare tanquam noster caesium. Ut suscipit posuere justo at vulputate. Sunt accentores vitare salvus flavum parses. Ubi est audax amicitia. Morbi tempus commodo mattis. Abnobas sunt hilotaes de placidus vita.
Questa è un'applicazione demo creata con il Framework Symfony per illustrare il modo raccomandato per sviluppare applicazioni con Symfony.
Per altre informazioni, visita la documentazione di Symfony.
Clicca su questo pulsante per mostare il codice sorgente dei controllori e template usati per effettuare il render di questa pagina.
src/Presentation/Controller/Blog/Visitor/Post/GetLatestPostsController.php at line 55
/**
* NOTE: For standard formats, Symfony will also automatically choose the best
* Content-Type header for the response.
*
* See https://symfony.com/doc/current/routing.html#special-parameters
*
* @param Request $request
* @param int $page
* @param string $_format
* @return Response
*/
#[Route('/', name: 'blog_index', defaults: ['page' => '1', '_format' => 'html'], methods: ['GET'])]
#[Route('/rss.xml', name: 'blog_rss', defaults: ['page' => '1', '_format' => 'xml'], methods: ['GET'])]
#[Route(
'/page/{page<[1-9]\d{0,8}>}',
name: 'blog_index_paginated',
defaults: ['_format' => 'html'],
methods: ['GET']
)]
#[Cache(smaxage: 10)]
public function index(Request $request, int $page, string $_format): Response
{
// Here we call usecase to retrieve latest posts
$this
->getLatestPostsUsecase
->setRequest($this->getLatestPostsRequest::from([
'tag' => $request->query->get('tag'),
'page' => $page,
]))
->setPresenter($this->getLatestPostsPresenter)
->execute();
// Every template name also has two extensions that specify the format and
// engine for that template.
// See https://symfony.com/doc/current/templates.html#template-naming
return $this->render('blog/index.' . $_format . '.twig', $this->getLatestPostsPresenter->getResponseData());
}