<?php
namespace App\Controller;
use App\Mongo\Ams\Profile;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
* Class IndexController
*/
class IndexController extends AbstractController
{
/**
* @Route("/")
*
* @return Response
*/
public function index(): Response
{
return $this->redirect('/booking');
}
/**
* Provide global dropdown options
*
* @Route("/options/{type}")
*
* @param string $type
*
* @return Response
*/
public function options(string $type): Response
{
switch ($type) {
case 'advertisers':
$model = new Profile();
$options = $model->getOptionList();
break;
default:
$options = null;
break;
}
return $this->json($options);
}
}