public static function handle_request() { self::setup(); SilkRoute::load_routes(); $params = array(); try { $params = SilkRoute::match_route(SilkRequest::get_requested_page()); $class_name = camelize($params['controller'] . '_controller'); if (class_exists($class_name)) { $controller = new $class_name(); } else { throw new SilkControllerNotFoundException(); } echo $controller->run_action($params['action'], $params); } catch (SilkRouteNotMatchedException $ex) { die("route not found"); } catch (SilkControllerNotFoundException $ex) { die("controller not found"); } catch (SilkViewNotFoundException $ex) { die("template not found"); } }