JsonHelper
class JsonHelper implements ProtectedContextAwareInterface (View source)
JSON helpers for Eel contexts
Methods
string
stringify(mixed $value, array $options = [])
JSON encode the given value
mixed
parse(string $json, bool $associativeArrays = true)
JSON decode the given string
bool
allowsCallOfMethod(string $methodName)
All methods are considered safe
Details
string
stringify(mixed $value, array $options = [])
JSON encode the given value
Usage example for options:
Json.stringify(value, ['JSON_UNESCAPED_UNICODE', 'JSON_FORCE_OBJECT'])
mixed
parse(string $json, bool $associativeArrays = true)
JSON decode the given string
bool
allowsCallOfMethod(string $methodName)
All methods are considered safe