Symfony Demo
  • Prima pagină
  • Search
  • Choose language
    • العربية 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 noiembrie 2017 la 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

  • Pagina anterioara
  • 1
  • 2 (current)
  • Pagina urmatoare

Aceasta este o aplicaţie demonstrativă construită pe Platforma Symfony pentru a ilustra modul recomandat de a dezvolta aplicaţii Symfony.

Pentru mai multe informaţii, citeşte documentaţia Symfony.

Fă click pe acest buton pentru afişarea codului sursă din controlerul şi şablonul folosite în acestă pagină.

Codul sursă folosit în această pagină

Codul din controlersrc/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,
    ]);
}

Codul din şablonul Twigtemplates/blog/index.html.twig at line 1

Blog Posts RSS

© 2025 - The Symfony Project

Licenţă MIT