src/Controller/DefaultController.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
  5. use Symfony\Component\HttpFoundation\Request;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\HttpFoundation\JsonResponse;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class DefaultController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/")
  13.      */
  14.     public function indexAction()
  15.     {
  16.       $buildNo = time();
  17.         // replace this example code with whatever you need
  18.         return $this->render('default/index.html.twig', [
  19.             'base_dir' => realpath($this->getParameter('kernel.project_dir').'/..'),
  20.             'buildNo'=> $buildNo
  21.         ]);
  22.     }
  23.     /**
  24.      * @Route("/mobile-redirect")
  25.      */
  26.     public function mobileRedirectAction()
  27.     {
  28.         return $this->render('default/mobile-redirect.html.twig');
  29.     }
  30.   /**
  31.    * Get Onboarding Url
  32.    *
  33.    * @Route("/getonboardingurl")
  34.    *
  35.    * @throws  NotFoundHttpException
  36.    * @return  JsonResponse
  37.    */
  38.   public function getOnboardingUrlAction()
  39.   {
  40.     $onboardingUrl = $_ENV['onboardingUrl'];
  41.     $data = [
  42.       'onboardingUrl'=>$onboardingUrl,
  43.       'LHdefLang' => $this->getParameter('LHdefLang'),
  44.       'LHdefCountry' => $this->getParameter('LHdefCountry')
  45.     ];
  46.     //SerializationContext::create()->enableMaxDepthChecks()->setGroups(array('app'))
  47.     return new JsonResponse($data);
  48.   }
  49. }