WIP: Implement CRUD, improve menu configuration
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller\Teamer;
|
||||
|
||||
use App\Repository\FaqRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\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.html.twig', [
|
||||
'faqs' => $faqs,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user