4 header("Access-Control-Allow-Origin: http://172.17.12.110:8000");
6 require_once('../vendor/autoload.php');
8 // Set up the DI container
9 $containerBuilder = new DI\
ContainerBuilder();
10 $containerBuilder->addDefinitions('../config/DI.php');
11 $containerBuilder->useAutowiring(true
);
13 $container = $containerBuilder->build();
15 /* @var $router Services\Routing\IRouter */
16 $router = $container->get('Services\Routing\IRouter');
18 $controllerName= $router->getControllerName();
19 $controllerAction = $router->getActionName();
20 $controllerActionArgs = $router->getActionArgs();
22 $controller = $container->get('Controllers\\' . ucfirst($controllerName) . 'Controller' );
24 // Last thing to do, call the action on the specified controller.
25 call_user_func(array($controller, $controllerAction . 'Action'), $controllerActionArgs);