Back to MessageRenderer class

Method render

public string
render
(mixed $name, mixed $params = array(), mixed $content = null)
Renders the error stack and returns the results as a string
Parameters
  • string $name Not used.
  • array $params Associative array of values
  • string $content Not used.
Returns
  • string The output of the script
Since
  • 3.5

Method render - Source code

/**
 * Renders the error stack and returns the results as a string
 *
 * @param   string  $name     Not used.
 * @param   array   $params   Associative array of values
 * @param   string  $content  Not used.
 *
 * @return  string  The output of the script
 *
 * @since   3.5
 */
public function render($name, $params = array(), $content = null)
{
    $msgList = $this->getData();
    $displayData = array('msgList' => $msgList, 'name' => $name, 'params' => $params, 'content' => $content);
    $app = Factory::getApplication();
    $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/message.php';
    if (is_file($chromePath)) {
        include_once $chromePath;
    }
    if (\function_exists('renderMessage')) {
        @trigger_error('renderMessage() is deprecated. Override system message rendering with layouts instead.', E_USER_DEPRECATED);
        return renderMessage($msgList);
    }
    return LayoutHelper::render('joomla.system.message', $displayData);
}