src/Controller/Front/LegalController.php line 41

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Manager\{PolicyManager};
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class LegalController extends AbstractController
  8. {
  9.     protected array $locals = [];
  10.     public function __construct()
  11.     {
  12.         $this->locals['menu_active'] = '';
  13.     }
  14.     /**
  15.      * @Route("/politicas-de-privacidad/", name="privacy")
  16.      * @Template("front/legal/legal.html.twig")
  17.      */
  18.     public function privacy(PolicyManager $pm): array
  19.     {
  20.         $info $pm->find(1);
  21.         $this->locals['detail'] = [
  22.             'title' => $info->getPrivacyTitle(),
  23.             'titular' => $info->getPrivacyTitular(),
  24.             'text' => $info->getPrivacyText(),
  25.         ];
  26.         $this->locals['home'] = $info;
  27.         $this->locals['menu_active'] = 'privacy';
  28.         $this->locals['canonical'] = $this->generateUrl('privacy');
  29.         return $this->locals;
  30.     }
  31.     /**
  32.      * @Route("/terminos-y-condiciones/", name="terms")
  33.      * @Template("front/legal/legal.html.twig")
  34.      */
  35.     public function terms(PolicyManager $pm): array
  36.     {
  37.         $info $pm->find(1);
  38.         $this->locals['detail'] = [
  39.             'title' => $info->getTermTitle(),
  40.             'titular' => $info->getTermTitular(),
  41.             'text' => $info->getTermText(),
  42.         ];
  43.         $this->locals['home'] = $info;
  44.         $this->locals['menu_active'] = 'terms';
  45.         $this->locals['canonical'] = $this->generateUrl('terms');
  46.         return $this->locals;
  47.     }
  48.     /**
  49.      * @Route("/politicas-de-cookies/", name="cookies")
  50.      * @Template("front/legal/legal.html.twig")
  51.      */
  52.     public function cookies(PolicyManager $pm): array
  53.     {
  54.         $info $pm->find(1);
  55.         $this->locals['detail'] = [
  56.             'title' => $info->getCookieTitle(),
  57.             'titular' => $info->getCookieTitular(),
  58.             'text' => $info->getCookieText(),
  59.         ];
  60.         $this->locals['home'] = $info;
  61.         $this->locals['menu_active'] = 'cookies';
  62.         $this->locals['canonical'] = $this->generateUrl('cookies');
  63.         return $this->locals;
  64.     }
  65.     /**
  66.      * @Route("/derechos-arco/", name="arco")
  67.      * @Template("front/legal/legal.html.twig")
  68.      */
  69.     public function arco(PolicyManager $pm): array
  70.     {
  71.         $info $pm->find(1);
  72.         $this->locals['detail'] = [
  73.             'title' => $info->getArcoTitle(),
  74.             'titular' => $info->getArcoTitular(),
  75.             'text' => $info->getArcoText(),
  76.         ];
  77.         $this->locals['home'] = $info;
  78.         $this->locals['menu_active'] = 'arco';
  79.         $this->locals['canonical'] = $this->generateUrl('arco');
  80.         return $this->locals;
  81.     }
  82. }