/**
* Outputs the document.
*
* @param boolean $cache If true, cache the output.
* @param array $params Associative array of attributes.
*
* @return string The rendered data.
*
* @since 4.0.0
*/
public function render($cache = false, $params = array())
{
$app = Factory::getApplication();
if ($mdate = $this->getModifiedDate()) {
$app->modifiedDate = $mdate;
}
$app->mimeType = $this->_mime;
$app->charSet = $this->_charset;
return json_encode($this->document);
}