<?php
namespace App\Controller;
use App\Entity\Expert;
use App\Form\ExpertType;
use App\Repository\ExpertRepository;
use App\Repository\LabelRepository;
use App\Repository\SettingRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
* @Route("/nosexperts")
*/
class ExpertController extends AbstractController
{
/**
* @Route("/", name="app_expert_index", methods={"GET"})
*/
public function index(
ExpertRepository $expertRepository,
SettingRepository $settingRepository,
LabelRepository $labelRepository
): Response {
return $this->render('expert/index.html.twig', [
'experts' => $expertRepository->findAll(),
'settings' => $settingRepository->findAll(),
'labels' => $labelRepository->findAll(),
'pageTitle' => 'experts'
]);
}
/**
* @Route("/{slug}", name="app_expert_show", methods={"GET"})
*/
public function show(
Expert $expert,
SettingRepository $settingRepository,
LabelRepository $labelRepository
): Response {
return $this->render('expert/show.html.twig', [
'expert' => $expert,
'settings' => $settingRepository->findAll(),
'labels' => $labelRepository->findAll(),
'pageTitle' => 'experts'
]);
}
}