public function escape($text, $flags = ENT_COMPAT, $charset = null, $doubleEncode = true)
    {
        return htmlspecialchars($text, $flags, $charset ?: $this['charset'], $doubleEncode);
    }
public function escape($text, $flags = ENT_COMPAT, $charset = null, $doubleEncode = true)
    {
        return htmlspecialchars($text, $flags, $charset ?: $this['charset'], $doubleEncode);
    }
public function escape ( $ text , $ flags = ENT_COMPAT , $ charset = null , $ doubleEncode = true ) { return htmlspecialchars ( $ text , $ flags , $ charset ? : $ this [ 'charset' ] , $ doubleEncode ) ; }
Escapes a text for HTML.

@param string $text         The input text to be escaped
@param int    $flags        The flags (@see htmlspecialchars)
@param string $charset      The charset
@param bool   $doubleEncode Whether to try to avoid double escaping or not

@return string Escaped text
Escapes a text for HTML .