public function render($cache = false, $params = array()) { MResponse::allowCache(false); MResponse::setHeader('Content-disposition', 'attachment; filename="' . $this->getName() . '.json"', true); parent::render(); return $this->getBuffer(); }
public function render($cache = false, $params = array()) { // If no error object is set return null if (!isset($this->_error)) { return; } // Set the status header MResponse::setHeader('status', $this->_error->getCode() . ' ' . str_replace("\n", ' ', $this->_error->getMessage())); $file = 'error.php'; // Check template $directory = isset($params['directory']) ? $params['directory'] : 'templates'; $template = isset($params['template']) ? MFilterInput::getInstance()->clean($params['template'], 'cmd') : 'system'; if (!file_exists($directory . '/' . $template . '/' . $file)) { $template = 'system'; } // Set variables $this->baseurl = MURI::base(true); $this->template = $template; $this->debug = isset($params['debug']) ? $params['debug'] : false; $this->error = $this->_error; // Load $data = $this->_loadTemplate($directory . '/' . $template, $file); parent::render(); return $data; }
public function render($cache = false, $params = array()) { parent::render(); MResponse::setHeader('Content-disposition', 'inline; filename="' . $this->getName() . '.xml"', true); return $this->getBuffer(); }
protected function _setEtag($etag) { MResponse::setHeader('ETag', $etag, true); }
public function render($cache = false, $params = array()) { if ($mdate = $this->getModifiedDate()) { MResponse::setHeader('Last-Modified', $mdate); } MResponse::setHeader('Content-Type', $this->_mime . ($this->_charset ? '; charset=' . $this->_charset : '')); }