<?php
namespace App\Controller\Front;
use App\Manager\{PolicyManager};
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class LegalController extends AbstractController
{
protected array $locals = [];
public function __construct()
{
$this->locals['menu_active'] = '';
}
/**
* @Route("/politicas-de-privacidad/", name="privacy")
* @Template("front/legal/legal.html.twig")
*/
public function privacy(PolicyManager $pm): array
{
$info = $pm->find(1);
$this->locals['detail'] = [
'title' => $info->getPrivacyTitle(),
'titular' => $info->getPrivacyTitular(),
'text' => $info->getPrivacyText(),
];
$this->locals['home'] = $info;
$this->locals['menu_active'] = 'privacy';
$this->locals['canonical'] = $this->generateUrl('privacy');
return $this->locals;
}
/**
* @Route("/terminos-y-condiciones/", name="terms")
* @Template("front/legal/legal.html.twig")
*/
public function terms(PolicyManager $pm): array
{
$info = $pm->find(1);
$this->locals['detail'] = [
'title' => $info->getTermTitle(),
'titular' => $info->getTermTitular(),
'text' => $info->getTermText(),
];
$this->locals['home'] = $info;
$this->locals['menu_active'] = 'terms';
$this->locals['canonical'] = $this->generateUrl('terms');
return $this->locals;
}
/**
* @Route("/politicas-de-cookies/", name="cookies")
* @Template("front/legal/legal.html.twig")
*/
public function cookies(PolicyManager $pm): array
{
$info = $pm->find(1);
$this->locals['detail'] = [
'title' => $info->getCookieTitle(),
'titular' => $info->getCookieTitular(),
'text' => $info->getCookieText(),
];
$this->locals['home'] = $info;
$this->locals['menu_active'] = 'cookies';
$this->locals['canonical'] = $this->generateUrl('cookies');
return $this->locals;
}
/**
* @Route("/derechos-arco/", name="arco")
* @Template("front/legal/legal.html.twig")
*/
public function arco(PolicyManager $pm): array
{
$info = $pm->find(1);
$this->locals['detail'] = [
'title' => $info->getArcoTitle(),
'titular' => $info->getArcoTitular(),
'text' => $info->getArcoText(),
];
$this->locals['home'] = $info;
$this->locals['menu_active'] = 'arco';
$this->locals['canonical'] = $this->generateUrl('arco');
return $this->locals;
}
}