Back to XmlDocument class

Method render

public string
render
(mixed $cache = false, mixed $params = array())
Render the document.
Parameters
  • bool $cache If true, cache the output
  • array $params Associative array of attributes
Returns
  • string The rendered data
Since
  • 1.7.0
Class: XmlDocument
Project: Joomla

Method render - Source code

/**
 * Render the document.
 *
 * @param   boolean  $cache   If true, cache the output
 * @param   array    $params  Associative array of attributes
 *
 * @return  string  The rendered data
 *
 * @since  1.7.0
 */
public function render($cache = false, $params = array())
{
    parent::render($cache, $params);
    $disposition = $this->isDownload ? 'attachment' : 'inline';
    CmsFactory::getApplication()->setHeader('Content-disposition', $disposition . '; filename="' . $this->getName() . '.xml"', true);
    return $this->getBuffer();
}