ResponseHandler
in package
Table of Contents
- $response : Response
- $instance : ResponseHandler|null
- __construct() : mixed
- getInstance() : ResponseHandler
- json() : ResponseHandler
- make() : Response
- Retrieves the raw Response object. When this is used, headers, cookies, etc., will need to be attached manually.
- makeNew() : ResponseHandler
- Creates a new Response object.
- ok() : bool
- render() : string
Properties
$response
protected
Response
$response
$instance
private
static ResponseHandler|null
$instance
= null
Methods
__construct()
public
__construct() : mixed
Return values
mixed —getInstance()
public
static getInstance() : ResponseHandler
Return values
ResponseHandler —json()
public
json([mixed $content = [] ][, int $status = 200 ]) : ResponseHandler
Parameters
- $content : mixed = []
- $status : int = 200
Return values
ResponseHandler —make()
Retrieves the raw Response object. When this is used, headers, cookies, etc., will need to be attached manually.
public
make() : Response
Return values
Response —makeNew()
Creates a new Response object.
public
makeNew() : ResponseHandler
Return values
ResponseHandler —ok()
public
ok() : bool
Return values
bool —render()
public
render(string $view[, array<string|int, mixed> $data = [] ][, mixed $status = 200 ][, mixed $headers = [] ]) : string
Parameters
- $view : string
- $data : array<string|int, mixed> = []
- $status : mixed = 200
- $headers : mixed = []