/** * Run a project */ public function run() { $cmv = array('controller' => $this->config->get('defaultController'), 'method' => $this->config->get('defaultMethod'), 'vars' => array()); $_uri = new URI(); $_uri->_fetch_uri_string(); $path = (string) $_uri; if (!empty($path)) { $founded = $this->router->findRoute($path); if (!empty($founded)) { $cmv = $founded; } else { //append uri parts as variables for method invocation $cmv['vars'] = explode('/', $path); } } //must be defined before view->render, sorry for hardcode if (DRAGON_DEBUG) { header('X-Dragon-Debug: ' . Dragon::$host . 'tmp/debug/last.html'); } //finally we have something to show $this->loadController($cmv); $this->view->render(); DebugGenerator::generate(); }