mini\Controller\AbstractController::json() Method

protected

Signature

protected function json(mixed $data, int $status = 200, array $headers = array (
)): Psr\Http\Message\ResponseInterface

Parameters

Name Type Default Description
$data mixed required Documentation missing
$status int 200 Documentation missing
$headers array array ( ) Documentation missing

Returns

Psr\Http\Message\ResponseInterface

Documentation

Explicit JSON response

Always returns JSON regardless of Accept header.

Source

src/Controller/AbstractController.php:144-154