Symfony Demo
  • Homepage
  • Search
  • Choose language

Choose your language

  • العربية ar
  • Български bg
  • Bosanski bs
  • Català ca
  • Čeština cs
  • Deutsch de
  • English en
  • Español es
  • Euskara eu
  • Français fr
  • Hrvatski hr
  • Indonesia id
  • Italiano it
  • 日本語 ja
  • Lietuvių lt
  • Nederlands nl
  • Polski pl
  • Português (brasil) pt_BR
  • Română ro
  • Русский ru
  • Slovenščina sl
  • Српски (ћирилица) sr_Cyrl
  • Srpski (latinica) sr_Latn
  • Türkçe tr
  • Українська uk
  • 中文(中国) zh_CN

Sunt torquises imitari velox mirabilis medicinaes

November 15, 2023 at 8:09:50 AM Tom Doe

Vae humani generis. Eposs sunt solems de superbus fortis. Abnobas sunt hilotaes de placidus vita. Era brevis ratione est. Mineralis persuadere omnes finises desiderium. Sunt accentores vitare salvus flavum parses.

dolore ipsum voluptate

Bassus fatalis classiss virtualiter transferre de flavum

November 13, 2023 at 10:45:52 AM Jane Doe

Abnobas sunt hilotaes de placidus vita. Ubi est audax amicitia. Vae humani generis. Bassus fatalis classiss virtualiter transferre de flavum. Era brevis ratione est. Sunt accentores vitare salvus flavum parses. Potus sensim ad ferox abnoba.

dolore labore lorem

  • Previous
  • 1
  • 2 (current)
  • Next

This is a demo application built in the Symfony Framework to illustrate the recommended way of developing Symfony applications.

For more information, check out the Symfony doc.

Click on this button to show the source code of the Controller and template used to render this page.

Source code used to render this page
  • Controller code
  • Twig template code

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());
}

templates/blog/index.html.twig at line 1

Blog Posts RSS

© 2026 - The Symfony Project made with clean/hexagonal architecture.

MIT License