Skip to content

Kirby 6.0.0

ViewDocumentResponse::json()

Creates a json response with appropriate header and automatic conversion of arrays.

ViewDocumentResponse::json(array|string $body = '', int|null $code = null, bool $pretty = false, array $headers = []): ViewDocumentResponse

Parameters

Name Type Default
$body arrayorstring ''
$code intornull null
$pretty bool false
$headers array []

Return type

Kirby\Panel\Response\ViewDocumentResponse

Parent class

Kirby\Panel\Response\ViewDocumentResponse inherited from Kirby\Http\Response