src/AppBundle/Controller/BFF/HomeController.php line 28
<?php
namespace AppBundle\Controller\BFF;
use AppBundle\Controller\Controller;
use AppBundle\Services\BFF\HomeService;
use MobileDetectBundle\DeviceDetector\MobileDetectorInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Routing\Annotation\Route;
class HomeController extends Controller
{
public function __construct(
private HomeService $homeService,
private MobileDetectorInterface $mobileDetector,
)
{
//$this->mobileDetector = $mobileDetector;
}
#[Route('/', name: 'homepage')]
public function index()
{
return $this->render('frontend/index.html.twig');
}
#[Route('/terminos-condiciones/politica-devoluciones', name: 'politica-devoluciones')]
public function politicaDevoluciones()
{
if ($this->mobileDetector->isMobile()) {
$template = 'mobile/misc/politica-devoluciones.html.twig';
} else {
$template = 'frontend/misc/politica-devoluciones.html.twig';
}
return $this->render($template);
}
/** UI- KIT PIN
* Muestra informaciĆ³n sobre el UI kit y las recomendaciones de diseƱo de la PIN
*/
#[Route('/kit-ui', name: 'kit-ui')]
public function kitUIAction()
{
return $this->render('frontend/misc/kit-ui.html.twig');
}
#[Route('/sucursales', name: 'sucursales')]
public function sucursalesAction()
{
return $this->render('frontend/index.html.twig');
}
#[Route('/ayuda', name: 'faq-alta-usuario')]
public function faqAltaUsuarioAction()
{
return $this->render('frontend/index.html.twig');
}
#[Route('/ayuda/mi-perfil', name: 'perfil')]
public function perfilAction()
{
return $this->render('frontend/index.html.twig');
}
#[Route('/ayuda/catalogo', name: 'catalogo')]
public function catalogoAction()
{
return $this->render('frontend/index.html.twig');
}
#[Route('/ayuda/compras', name: 'compras')]
public function comprasAction()
{
return $this->render('frontend/index.html.twig');
}
#[Route('/ayuda/pagos', name: 'pagos')]
public function pagosAction()
{
return $this->render('frontend/index.html.twig',['activo'=>'pagos']);
}
#[Route('/ayuda/entregas', name: 'entregas')]
public function entregasAction()
{
return $this->render('frontend/index.html.twig',['activo'=>'entregas']);
}
#[Route(['/nosotros', '/nosotros/{slug}'])]
public function nosotros()
{
return $this->render('frontend/index.html.twig');
}
#[Route(['/informacion-tecnica', '/informacion-tecnica/{slug}'])]
public function informacionTenica()
{
return $this->render('frontend/index.html.twig');
}
#[Route('/terminos-condiciones', name: 'terminos-condiciones')]
public function terminosCondicionesAction()
{
if ($this->mobileDetector->isMobile()) {
$template = 'frontend/mobile/misc/terminos-condiciones.html.twig';
} else {
$template = 'frontend/misc/terminos-condiciones.html.twig';
}
return $this->render($template);
}
#[Route('/arq', name: 'landing-wix')]
public function landingWixAction()
{
return new RedirectResponse('https://contenidos.famiq.com.ar/arquitectura');
}
#[Route('/ayuda/preguntas/{seccion}')]
public function obtenerPreguntas(String $seccion)
{
return new JsonResponse($this->homeService->getPreguntasPorSeccion($seccion));
}
#[Route('/ayuda/destacados/{busqueda?null}', name: 'faq-destacados')]
public function obtenerDestacados(String $busqueda = "")
{
return new JsonResponse($this->homeService->obtenerDestacados($busqueda));
}
#[Route('/tipo-cambio', name: 'tipo-cambio')]
public function getCotizacionDiaria()
{
return new JsonResponse($this->homeService->getCotizacionDiaria());
}
#[Route('/informacion-tecnica/glosario/definiciones', methods: ['GET'], name: 'glosario-definiciones')]
public function getDefiniciones()
{
return new JsonResponse($this->homeService->getDefiniciones());
}
#[Route('/info-de-carrito', methods: ['GET'], name: 'info-de-carrito')]
public function infoDeCarrito()
{
return new JsonResponse($this->homeService->infoDeCarrito());
}
#[Route('/cotizacion-moneda-del-dia', methods: ['GET'], name: 'cotizacion-del-dia')]
public function getCotizacionDelDiaAsync()
{
$data = $this->homeService->getCotizacionDelDiaAsync();
return new JsonResponse($data['cotizacionDelDia']);
}
#[Route('/componente/{id}', methods: ['GET'], name: 'datos-componente')]
public function obtenerDatosDeComponente($id)
{
return new JsonResponse($this->homeService->obtenerDatosDeComponente($id));
}
#[Route('/burguer-data', name: 'burguer-data')]
public function burguerData()
{
return new JsonResponse($this->homeService->burguerData());
}
#[Route('/estructura', methods: 'GET')]
public function indexAction(): JsonResponse
{
return new JsonResponse($this->homeService->indexAction());
}
#[Route('/lineas-de-productos', name: 'lineas-de-productos')]
public function lineaProducto()
{
$data = $this->homeService->lineaProducto();
$template = $data['template'];
$categorias = $data['categorias'];
return $this->render($template, array('categorias' => $categorias));
}
#[Route('/faq/legajo-impositivo', name: 'faq-legajos-impositivos')]
public function faqLegajosImpositivosAction()
{
return $this->render('frontend/index.html.twig');
}
#[Route('/faq/legajo-impositivo/archivos', name: 'faq-legajos-impositivos-archivos')]
public function faqLegajosImpositivosArchivos()
{
$data = $this->homeService->faqLegajosImpositivosAction();
return new JsonResponse(["data"=>$data]);
}
#[Route('/novedad/{id}', name: 'novedad')]
public function novedad()
{
return $this->render('frontend/index.html.twig');
}
}