yii\i18n\Formatter::asHtml PHP Method

asHtml() public method

The value will be purified using [[HtmlPurifier]] to avoid XSS attacks. Use Formatter::asRaw if you do not want any purification of the value.
public asHtml ( string $value, array | null $config = null ) : string
$value string the value to be formatted.
$config array | null the configuration for the HTMLPurifier class.
return string the formatted result.
    public function asHtml($value, $config = null)
    {
        if ($value === null) {
            return $this->nullDisplay;
        }
        return HtmlPurifier::process($value, $config);
    }