yii\helpers\HtmlPurifier - Yii2 类参考手册
Class yii\helpers\HtmlPurifier
全部
| 方法 Methods
Inheritance | yii\helpers\HtmlPurifier » yii\helpers\BaseHtmlPurifier |
---|---|
Available since version | 2.0 |
HtmlPurifier provides an ability to clean up HTML from any harmful code.
Basic usage is the following:
echo HtmlPurifier::process($html);
If you want to configure it:
echo HtmlPurifier::process($html, [
'Attr.EnableID' => true,
]);
For more details please refer to HTMLPurifier documentation.
Public Methods
隐藏继承的方法 Hide inherited methods
方法 Method | 简介 Description | 定义在 Defined By |
---|---|---|
process() | Passes markup through HTMLPurifier making it safe to output to end user. | yii\helpers\BaseHtmlPurifier |
Protected Methods
隐藏继承的方法 Hide inherited methods
方法 Method | 简介 Description | 定义在 Defined By |
---|---|---|
configure() | Allow the extended HtmlPurifier class to set some default config options. | yii\helpers\BaseHtmlPurifier |