/** * Render the View and display the result. * * @return void */ public function display() { Response::sendHeaders(); $this->render(); }
protected function dispatchFile($uri) { // For properly Assets serving, the file URI should be as following: // // /templates/default/assets/css/style.css // /modules/blog/assets/css/style.css // /assets/css/style.css $filePath = ''; if (preg_match('#^assets/(.*)$#i', $uri, $matches)) { $filePath = ROOTDIR . 'assets' . DS . $matches[1]; } else { if (preg_match('#^(templates|modules)/(.+)/assets/(.*)$#i', $uri, $matches)) { // We need to classify the path name (the Module/Template path). $basePath = ucfirst($matches[1]) . DS . Inflector::classify($matches[2]); $filePath = APPDIR . $basePath . DS . 'Assets' . DS . $matches[3]; } } if (!empty($filePath)) { // Serve the specified Asset File. Response::serveFile($filePath); return true; } return false; }