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 de noviembre de 2023, 9: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.
Esta aplicación demo ha sido programada con el framework Symfony para mostrar la forma recomendada de programar aplicaciones Symfony.
Para más información, consulta la documentación de Symfony.
Pulsa este botón para ver el código fuente del controlador y de la plantilla utilizados para crear esta página.
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());
}