Back to HtmlDocument class

Method render

public string
render
(mixed $caching = false, mixed $params = array())
Outputs the template to the browser.
Parameters
  • bool $caching If true, cache the output
  • array $params Associative array of attributes
Returns
  • string The rendered data
Since
  • 1.7.0
Class: HtmlDocument
Project: Joomla

Method render - Source code

/**
 * Outputs the template to the browser.
 *
 * @param   boolean  $caching  If true, cache the output
 * @param   array    $params   Associative array of attributes
 *
 * @return  string The rendered data
 *
 * @since   1.7.0
 */
public function render($caching = false, $params = array())
{
    $this->_caching = $caching;
    if (empty($this->_template)) {
        $this->parse($params);
    }
    if (\array_key_exists('csp_nonce', $params) && $params['csp_nonce'] !== null) {
        $this->cspNonce = $params['csp_nonce'];
    }
    $data = $this->_renderTemplate();
    parent::render($caching, $params);
    return $data;
}