/**
* 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())
{
/** @var \Joomla\CMS\Application\CMSApplication $app */
$app = CmsFactory::getApplication();
$app->allowCache($cache);
if ($this->_mime === 'application/json') {
// Browser other than Internet Explorer < 10
$app->setHeader('Content-Disposition', 'attachment; filename="' . $this->getName() . '.json"', true);
}
parent::render($cache, $params);
return $this->getBuffer();
}