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

Bassus fatalis classiss virtualiter transferre de flavum

6 novembre 2017 alle ore 17:36:43 Tom Doe

Sed varius a risus eget aliquam. Silva de secundus galatae demitto quadra. Pellentesque vitae velit ex. Mauris dapibus risus quis suscipit vulputate. Pellentesque et sapien pulvinar consectetur. Eros diam egestas libero eu vulputate risus.

ipsum labore lorem

  • 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 controlloresrc/Controller/BlogController.php at line 50

/**
 * @Route("/", defaults={"page": "1", "_format"="html"}, methods="GET", name="blog_index")
 * @Route("/rss.xml", defaults={"page": "1", "_format"="xml"}, methods="GET", name="blog_rss")
 * @Route("/page/{page<[1-9]\d*>}", defaults={"_format"="html"}, methods="GET", name="blog_index_paginated")
 * @Cache(smaxage="10")
 *
 * 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
 */
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 ? $tag->getName() : null,
    ]);
}

Codice del template Twigtemplates/blog/index.html.twig at line 1

RSS del blog

© 2025 - The Symfony Project

Licenza MIT