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'](); })); }
*/ $whoops = new Whoops\Run(); $whoops->pushHandler(new Whoops\Handler\PrettyPageHandler()); $whoops->register(); /** * Setting up the current request method */ Registry::set('application.request.method', $_SERVER['REQUEST_METHOD']); /** * Require the config files and add those results to the Registry */ Registry::set('config', require APP . 'config' . DS . 'config.php'); /** * Setting up the events manager */ Registry::set('foundation.events', new Events()); Events::create(array('title' => 'application.boot', 'event' => function () { })); /** * Setting the current HTTP request to the events manager */ 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'; })); /**