function __autoload($c) { $modulename = $_SERVER['DOCUMENT_ROOT'] . '/genus/' . strtolower($c) . '.php'; if (file_exists($modulename)) { require $modulename; } else { throw_error_page('I am an object of scorn to my accusers…'); } }
function dispatch() { if ($this->parg) { $controller_name = ucfirst($this->parg[1]) . 'Controller'; $controller = new $controller_name(); $action = strtolower($this->verb); $response = $controller->{$action}($this); } else { throw_error_page('utter poverty and weakness'); } return $response; }