src/Controller/ThemesWebsite/Cvs/Website/FaqController.php line 36

Open in your IDE?
  1. <?php
  2. namespace App\Controller\ThemesWebsite\Cvs\Website;
  3. use App\Entity\Cvs\FaqCategories;
  4. use App\Entity\Pages\Pages;
  5. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  7. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
  8. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  9. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  10. use Symfony\Component\HttpFoundation\Cookie;
  11. use Symfony\Component\HttpFoundation\JsonResponse;
  12. use Symfony\Component\HttpFoundation\RedirectResponse;
  13. use Symfony\Component\HttpFoundation\Request;
  14. use Symfony\Component\HttpFoundation\Response;
  15. use Symfony\Component\Routing\Annotation\Route;
  16. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  17. use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
  18. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  19. use Doctrine\ORM\EntityManagerInterface;
  20. class FaqController extends AbstractController
  21. {
  22.     private $em;
  23.     public function __construct(EntityManagerInterface $em)
  24.     {
  25.         $this->em $em;
  26.     }
  27.     public function dashboard(Request $request): Response
  28.     {
  29.         $page $this->em->getRepository(Pages::class)->findOneBy(['name' => 'faq']);
  30.         $categories $this->em->getRepository(FaqCategories::class)->findBy([],['title' => 'ASC']);
  31.         return $this->render('themesWebsite/cvs/website/faq.html.twig',[
  32.             'page' => $page,
  33.             'categories' => $categories
  34.         ]);
  35.     }
  36. }