Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public function render($cache = false, $params = array())
 {
     parent::render();
     MResponse::setHeader('Content-disposition', 'inline; filename="' . $this->getName() . '.xml"', true);
     return $this->getBuffer();
 }
Ejemplo n.º 4
0
 public function render($caching = false, $params = array())
 {
     $this->_caching = $caching;
     if (!empty($this->_template)) {
         $data = $this->_renderTemplate();
     } else {
         $this->parse($params);
         $data = $this->_renderTemplate();
     }
     parent::render();
     return $data;
 }
Ejemplo n.º 5
0
 public function render($cache = false, $params = array())
 {
     parent::render();
     return $this->getBuffer();
 }