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. новембар 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.
Ова демо апликација је направљена у радном оквиру Symfony као илустрација препорученог начина развоја Symfony aпликација.
За више информација погледајте Symfony документацију.
Кликните на дугме испод да бисте видели изворни код контролера и шаблона коришћених за приказ ове странице.
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());
}