$config['baseFolder'] . $config['baseRoute'], "routes"=>$routes); // Create the container $container = new Bootstrap($config, $routeInfo); // Start the application based on the route // TODO: Should this be in the Bootstrap? $currentRoute = $container->router->matchCurrentRequest(); if(!$currentRoute) { $container->render404(); } $params = $currentRoute->getParameters(); $target = $currentRoute->getTarget(); $parts = explode(':', $target); if(count($parts) < 2) { // configuration error throw new Exception("Route is not properly configured."); } $controllerName = $parts[0]; $action = $parts[1]; $className = $controllerName . 'Controller'; $actionName = $action . 'Action'; $controller = new $className($container); $controller->$actionName($params);