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 |
Please login to continue.