JSON
class JSON implements ResponseBuilderInterface
JSON builder.
Properties
protected mixed | $data | Data. | |
protected int | $options | JSON encode options. | |
protected string|null | $callback | Callback. | |
protected int|null | $status | Status code. | |
protected string|null | $charset | Character set. |
Methods
__construct(mixed $data, int $options = 0, int|null $status = null, string|null $charset = null)
Constructor.
asJsonpWith(string $callback)
Enables JSONP support.
setCharset(string $charset)
Sets the status code.
string
normalizeCallback(string $callback)
Ensures a valid callback name.
Details
at line 66
__construct(mixed $data, int $options = 0, int|null $status = null, string|null $charset = null)
Constructor.
at line 83
JSON
asJsonpWith(string $callback)
Enables JSONP support.
at line 96
JSON
setStatus(int $status)
Sets the status code.
at line 109
JSON
setCharset(string $charset)
Sets the status code.
at line 122
protected string
normalizeCallback(string $callback)
Ensures a valid callback name.