helpers\BaseJson htmlEncode()

htmlEncode() public static method (available since version 2.0.4)

Encodes the given value into a JSON string HTML-escaping entities so it is safe to be embedded in HTML code.

The method enhances json_encode() by supporting JavaScript expressions. In particular, the method will not encode a JavaScript expression that is represented in terms of a yii\web\JsExpression object.

public static string htmlEncode ( $value )
$value mixed

The data to be encoded

return string

The encoding result

throws yii\base\InvalidParamException

if there is any encoding error

doc_Yii
2016-10-30 17:05:27
Comments
Leave a Comment

Please login to continue.