More dataaccess stuff.
[rock.divinelegy.git] / public_html / index.php
1 <?php
2 require_once('../vendor/autoload.php');
3
4 // Set up the DI container
5 $containerBuilder = new DI\ContainerBuilder();
6 $containerBuilder->addDefinitions('../config/DI.php');
7 $containerBuilder->useAutowiring(true);
8
9 $container = $containerBuilder->build();
10
11 /* @var $router Services\Routing\IRouter */
12 $router = $container->get('Services\Routing\IRouter');
13
14 $controllerName= $router->getControllerName();
15 $controllerAction = $router->getActionName();
16 $controllerActionArgs = $router->getActionArgs();
17
18 $controller = $container->get('Controllers\\' . ucfirst($controllerName) . 'Controller' );
19
20 // Last thing to do, call the action on the specified controller.
21 call_user_func(array($controller, $controllerAction . 'Action'), $controllerActionArgs);
22