<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractController
{
/**
* @Route("/")
*/
public function indexAction()
{
$buildNo = time();
// replace this example code with whatever you need
return $this->render('default/index.html.twig', [
'base_dir' => realpath($this->getParameter('kernel.project_dir').'/..'),
'buildNo'=> $buildNo
]);
}
/**
* @Route("/mobile-redirect")
*/
public function mobileRedirectAction()
{
return $this->render('default/mobile-redirect.html.twig');
}
/**
* Get Onboarding Url
*
* @Route("/getonboardingurl")
*
* @throws NotFoundHttpException
* @return JsonResponse
*/
public function getOnboardingUrlAction()
{
$onboardingUrl = $_ENV['onboardingUrl'];
$data = [
'onboardingUrl'=>$onboardingUrl,
'LHdefLang' => $this->getParameter('LHdefLang'),
'LHdefCountry' => $this->getParameter('LHdefCountry')
];
//SerializationContext::create()->enableMaxDepthChecks()->setGroups(array('app'))
return new JsonResponse($data);
}
}