Response
in package
Table of Contents
- $response : array<string|int, mixed>
- __construct() : mixed
- Response constructor.
- __toString() : string
- clearHeader() : void
- Header gönderilmemişse temizlenir
- code() : $this
- http response code
- content() : $this
- set content
- getBody() : string
- Yanıt gövdesini döndürür
- getCode() : int
- getHeader() : array<string|int, mixed>|mixed
- headers() : $this
- set header
- redirect() : mixed
- send() : mixed
- print body to screen
- toJson() : $this
- setResponce() : string
Properties
$response
protected
array<string|int, mixed>
$response
= ['headers' => [], 'content' => null, 'code' => null]
Methods
__construct()
Response constructor.
public
__construct([null $content = null ][, null|int $code = 200 ][, mixed $headers = null ]) : mixed
Parameters
- $content : null = null
- $code : null|int = 200
- $headers : mixed = null
Return values
mixed —__toString()
public
__toString() : string
Return values
string —clearHeader()
Header gönderilmemişse temizlenir
public
clearHeader() : void
Return values
void —code()
http response code
public
code(int $code) : $this
Parameters
- $code : int
Return values
$this —content()
set content
public
content( $content) : $this
Parameters
Return values
$this —getBody()
Yanıt gövdesini döndürür
public
getBody() : string
Return values
string —getCode()
public
getCode() : int
Return values
int —getHeader()
public
getHeader() : array<string|int, mixed>|mixed
Return values
array<string|int, mixed>|mixed —headers()
set header
public
headers([string|array<string|int, mixed> $headers = null ]) : $this
Parameters
- $headers : string|array<string|int, mixed> = null
Return values
$this —redirect()
public
redirect([null $url = null ][, int $code = 302 ]) : mixed
Parameters
- $url : null = null
- $code : int = 302
Return values
mixed —send()
print body to screen
public
send() : mixed
Return values
mixed —toJson()
public
toJson([null $options = null ]) : $this
Parameters
- $options : null = null
Return values
$this —setResponce()
private
setResponce() : string