Commit 5f705db1 by Qiang Xue

Renamed Purifier to HtmlPurifier.

parent e8b94755
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
"psr-0": { "yii\\": "/" } "psr-0": { "yii\\": "/" }
}, },
"suggest": { "suggest": {
"michelf/php-markdown": "Required for Markdown helper.", "michelf/php-markdown": "Required by Markdown.",
"twig/twig": "Required for TwigViewRenderer.", "twig/twig": "Required by TwigViewRenderer.",
"smarty/smarty": "Required for SmartyViewRenderer.", "smarty/smarty": "Required by SmartyViewRenderer.",
"ezyang/htmlpurifier": "Required for Purifier helper." "ezyang/htmlpurifier": "Required by HtmlPurifier."
} }
} }
...@@ -8,18 +8,18 @@ ...@@ -8,18 +8,18 @@
namespace yii\helpers; namespace yii\helpers;
/** /**
* Purifier provides an ability to clean up HTML from any harmful code. * HtmlPurifier provides an ability to clean up HTML from any harmful code.
* *
* Basic usage is the following: * Basic usage is the following:
* *
* ```php * ```php
* $my_html = Purifier::process($my_text); * echo HtmlPurifier::process($html);
* ``` * ```
* *
* If you want to configure it: * If you want to configure it:
* *
* ```php * ```php
* $my_html = Purifier::process($my_text, array( * echo HtmlPurifier::process($html, array(
* 'Attr.EnableID' => true, * 'Attr.EnableID' => true,
* )); * ));
* ``` * ```
...@@ -29,6 +29,6 @@ namespace yii\helpers; ...@@ -29,6 +29,6 @@ namespace yii\helpers;
* @author Alexander Makarov <sam@rmcreative.ru> * @author Alexander Makarov <sam@rmcreative.ru>
* @since 2.0 * @since 2.0
*/ */
class Purifier extends base\Purifier class HtmlPurifier extends base\HtmlPurifier
{ {
} }
...@@ -7,28 +7,14 @@ ...@@ -7,28 +7,14 @@
namespace yii\helpers\base; namespace yii\helpers\base;
/** /**
* Purifier provides an ability to clean up HTML from any harmful code. * HtmlPurifier is the concrete implementation of the [[yii\helpers\HtmlPurifier]] class.
* *
* Basic usage is the following: * You should use [[yii\helpers\HtmlPurifier]] instead of this class in your application.
*
* ```php
* $my_html = Purifier::process($my_text);
* ```
*
* If you want to configure it:
*
* ```php
* $my_html = Purifier::process($my_text, array(
* 'Attr.EnableID' => true,
* ));
* ```
*
* For more details please refer to HTMLPurifier documentation](http://htmlpurifier.org/).
* *
* @author Alexander Makarov <sam@rmcreative.ru> * @author Alexander Makarov <sam@rmcreative.ru>
* @since 2.0 * @since 2.0
*/ */
class Purifier class HtmlPurifier
{ {
public static function process($content, $config = null) public static function process($content, $config = null)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment