<?php
namespace App\Controller\Publico;
use App\Entity\Ajustes\Faq;
use App\Repository\Ajustes\FaqRepository;
use App\Utils\HelperUtil;
use Doctrine\ORM\EntityManagerInterface;
use Knp\Component\Pager\PaginatorInterface;
use Sonata\SeoBundle\Seo\SeoPageInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
use WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs;
/**
* @Route("/faqs", name="faqs_")
*/
class FaqPublicController extends AbstractController
{
public const BASEDIR = Faq::BASEDIR;
public const ICON = Faq::ICON;
protected $em;
protected $bd;
protected $bag;
protected $pag;
protected $hlp;
protected $repo;
protected $trans;
protected $seo;
public function __construct(EntityManagerInterface $em, Breadcrumbs $bd, PaginatorInterface $pg, FaqRepository $repo, HelperUtil $hlp, ParameterBagInterface $pb, TranslatorInterface $trans, SeoPageInterface $seo)
{
$this->em = $em;
$this->bd = $bd;
$this->bag = $pb;
$this->pag = $pg;
$this->repo = $repo;
$this->hlp = $hlp;
$this->trans = $trans;
$this->seo = $seo;
}
/**
* @Route("/", name="index", options={"expose"=true})
*/
public function indexAction(Request $request): Response
{
//SEO
$titulo =$this->trans->trans('faq.page.seo.title', [], 'faq');
$descripcion =$this->trans->trans('faq.page.seo.description', [], 'faq');
$this->seo
->setTitle($titulo)
->addMeta('name', 'description', $descripcion)
->addMeta('property', 'og:title', $titulo)
->addMeta('property', 'og:description', $descripcion)
;
return $this->render(self::BASEDIR.'/faq_page_list.html.twig', [
'BaseDir' => self::BASEDIR,
'ICON' => self::ICON,
]);
}
}