<?php
namespace App\Controller;
use App\Entity\BlogCategory;
use App\Form\BlogCategoryType;
use App\Repository\BlogArticleRepository;
use App\Repository\LabelRepository;
use App\Repository\SettingRepository;
use App\Repository\BlogCategoryRepository;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
/**
* @Route("/categories")
*/
class BlogCategoryController extends AbstractController
{
/**
* @Route("/", name="app_blog_category_index", methods={"GET"})
*/
public function index(
BlogCategoryRepository $blogCategoryRepository,
SettingRepository $settingRepository,
LabelRepository $labelRepository
): Response {
return $this->render('blog_category/index.html.twig', [
'categories' => $blogCategoryRepository->findAll(),
'settings' => $settingRepository->findAll(),
'labels' => $labelRepository->findAll(),
'pageTitle' => 'categories'
]);
}
/**
* @Route("/{slug}", name="app_blog_category_show", methods={"GET"})
*/
public function show(
BlogCategory $blogCategory,
SettingRepository $settingRepository,
LabelRepository $labelRepository
): Response {
return $this->render('blog_category/show.html.twig', [
'category' => $blogCategory,
'settings' => $settingRepository->findAll(),
'labels' => $labelRepository->findAll(),
'pageTitle' => 'categories'
]);
}
}