Files
myep-team/src/Controller/Teamer/FaqController.php
T

26 lines
737 B
PHP

<?php
namespace App\Controller\Teamer;
use App\Repository\FaqRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class FaqController extends AbstractController
{
public function __construct(private readonly FaqRepository $faqRepository)
{}
#[Route('/teamer/faq', name: 'app_teamer_faq')]
#[IsGranted('ROLE_USER')]
public function index(): Response
{
$faqs = $this->faqRepository->findBy([], ['sorting' => 'ASC']);
return $this->render('teamer/faq/index.html.twig', [
'faqs' => $faqs,
]);
}
}