Symfony Demo
  • Homepage
  • Ricercare
  • Lingua

    Choose your language

    • العربية ar
    • Български bg
    • বাংলা bn
    • 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
    • नेपाली ne
    • Nederlands nl
    • Polski pl
    • Português (brasil) pt_BR
    • Română ro
    • Русский ru
    • Slovenščina sl
    • Shqip sq
    • Српски (ћирилица) sr_Cyrl
    • Srpski (latinica) sr_Latn
    • Türkçe tr
    • Українська uk
    • Tiếng việt vi
    • 中文(中国) zh_CN

Bassus fatalis classiss virtualiter transferre de flavum

26 febbraio 2025 alle ore 08:42:41 Jane Doe

Pellentesque vitae velit ex. Sunt seculaes transferre talis camerarius fluctuies. Sunt torquises imitari velox mirabilis medicinaes. Eros diam egestas libero eu vulputate risus. Pellentesque et sapien pulvinar consectetur.

incididunt ipsum labore

  • Precedente
  • 1
  • 2 (current)
  • Successivo

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.

Codice sorgente usato per effettuare il render di questa pagina
  • Codice del controllore
  • Codice del template Twig

src/Controller/BlogController.php at line 52

/**
 * 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
 */
#[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}', name: 'blog_index_paginated', defaults: ['_format' => 'html'], requirements: ['page' => Requirement::POSITIVE_INT], methods: ['GET'])]
#[Cache(smaxage: 10)]
public function index(Request $request, int $page, string $_format, PostRepository $posts, TagRepository $tags): Response
{
    $tag = null;

    if ($request->query->has('tag')) {
        $tag = $tags->findOneBy(['name' => $request->query->get('tag')]);
    }

    $latestPosts = $posts->findLatest($page, $tag);

    // 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', [
        'paginator' => $latestPosts,
        'tagName' => $tag?->getName(),
    ]);
}

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

RSS del blog

© 2025 - The Symfony Project

Licenza MIT