<?php
namespace App\Controller\ThemesWebsite\Cvs\Website;
use App\Entity\Cvs\FaqCategories;
use App\Entity\Pages\Pages;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Doctrine\ORM\EntityManagerInterface;
class FaqController extends AbstractController
{
private $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
public function dashboard(Request $request): Response
{
$page = $this->em->getRepository(Pages::class)->findOneBy(['name' => 'faq']);
$categories = $this->em->getRepository(FaqCategories::class)->findBy([],['title' => 'ASC']);
return $this->render('themesWebsite/cvs/website/faq.html.twig',[
'page' => $page,
'categories' => $categories
]);
}
}