কোন পোস্ট পাওয়া যায়নি।
এটি Symfony ফ্রেমওয়ার্কে নির্মিত একটি ডেমো অ্যাপ্লিকেশন যা Symfony অ্যাপ্লিকেশনগুলো ডেভেলপ করার প্রস্তাবিত উপায়গুলোকে চিত্রিত করে।
আরও বেশি তথ্যের জন্য সিম্ফনি নথিপত্র দেখুন।
পৃষ্ঠাটি রেন্ডার করতে ব্যবহৃত কন্ট্রলার এবং টেমপ্লেট-এর সোর্স কোড দেখানোর জন্য এই বোতামটি ক্লিক করুন।
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