Example #1
0
 protected function handleString($route)
 {
     Registry::set('application.controller.path', $this->resolveController($route));
     Events::create(array('title' => 'application.route', 'event' => function () {
         $action = Registry::get('application.controller.path');
         $route = new $action['controller']();
         $route->{$action}['method']();
     }));
 }
Example #2
0
 */
Events::create(array('title' => 'request.get', 'event' => function () {
    return SymfonyRequest::createFromGlobals();
}));
/**
 * Setting up the default error page
 */
Events::create(array('title' => 'application.error.404', 'event' => function () {
    return '<h2>Er is een fout opgetreden!</h2><p>De pagina waarop je gezocht op hebt, is helaas niet (meer) beschrikaar';
}));
/**
 * Creating all aliases for the original classes, they are specified in the config array
 */
foreach (Registry::get('config')['classAliases'] as $originalClass => $alias) {
    AliasLoader::create($originalClass, $alias);
}
/**
 * Attach all of the service providers (specified the config file) to the application
 */
foreach (Registry::get('config')['serviceProviders'] as $serviceProvider) {
    $app->register(new $serviceProvider());
}
require APP . 'routes.php';
/**
 * Boot the application
 */
$app->boot();
/**
 * Shutdown the application
 */
$app->shutdown();