helpers\BaseJson encode()

encode() public static method

Encodes the given value into a JSON string.

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 encode ( $value, $options = 320 )
$value mixed

The data to be encoded.

$options integer

The encoding options. For more details please refer to http://www.php.net/manual/en/function.json-encode.php. Default is JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE.

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.