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. studenoga 2023. u 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.
Ovo je demo web aplikacija napravljena unutar Symfony okvirne tehnologije, služi kako bi pokazala preporučeni način korištenja Symfony okvirne tehnologije.
Za više informacija, provjerite Symfony dokumentaciju.
Klikni na ovaj gumb kako bi pokazali izvorni kod od Kontrolora i Predloška korištenog prilikom stvaranja ove stranice.
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());
}