final class RequestData (View source)

Methods

__construct(ServerRequestInterface $request, HttpRequestInspector $inspector = new HttpRequestInspector())
ServerRequestInterface
ServerRequestInterface
mixed
input(string $key, mixed $default = null)
mixed
mixed
query(string $key, mixed $default = null)
mixed
array
array
mixed
post(string $key, mixed $default = null)
mixed
array
array
string|null
header(string $name, string|null $default = null)
string|null
array
array
mixed
cookie(string $name, mixed $default = null)
mixed
array
array
mixed
server(string $key, mixed $default = null)
mixed
array
array
string
body()
string
mixed
jsonInput(string $key, mixed $default = null)
mixed
array
array
bool
bool
bool
bool
bool
bool
UploadedFileInterface|array|null
file(string $name)
UploadedFileInterface|array|null
array
files()
array
bool
bool
string|null
ip()
string|null
string|null
userAgent(string|null $default = null)
string|null
string|null
referer(string|null $default = null)
string|null
string
method()
string
bool
isMethod(HttpMethod|string $method)
bool
bool
isGet()
bool
bool
isPost()
bool
bool
isPut()
bool
bool
bool
bool
bool
bool
isHead()
bool
bool
bool
string
inputString(string $key, string $default = '')
string
int
inputInt(string $key, int $default = 0)
int
float
inputFloat(string $key, float $default = 0.0)
float
bool
inputBool(string $key, bool $default = false)
bool

Details

__construct

__construct(ServerRequestInterface $request, HttpRequestInspector $inspector = new HttpRequestInspector())

No description

Parameters

ServerRequestInterface $request
HttpRequestInspector $inspector

request

ServerRequestInterface request()

No description

Return Value

ServerRequestInterface

input

mixed input(string $key, mixed $default = null)

No description

Parameters

string $key
mixed $default

Return Value

mixed

query

mixed query(string $key, mixed $default = null)

No description

Parameters

string $key
mixed $default

Return Value

mixed

queryAll

array queryAll()

No description

Return Value

array

post

mixed post(string $key, mixed $default = null)

No description

Parameters

string $key
mixed $default

Return Value

mixed

postAll

array postAll()

No description

Return Value

array

header

string|null header(string $name, string|null $default = null)

No description

Parameters

string $name
string|null $default

Return Value

string|null

headers

array headers()

No description

Return Value

array
mixed cookie(string $name, mixed $default = null)

No description

Parameters

string $name
mixed $default

Return Value

mixed

cookies

array cookies()

No description

Return Value

array

server

mixed server(string $key, mixed $default = null)

No description

Parameters

string $key
mixed $default

Return Value

mixed

serverAll

array serverAll()

No description

Return Value

array

body

string body()

No description

Return Value

string

jsonInput

mixed jsonInput(string $key, mixed $default = null)

No description

Parameters

string $key
mixed $default

Return Value

mixed

jsonPayload

array jsonPayload()

No description

Return Value

array

isJsonRequest

bool isJsonRequest()

No description

Return Value

bool

acceptsJson

bool acceptsJson()

No description

Return Value

bool

expectsJson

bool expectsJson()

No description

Return Value

bool

file

UploadedFileInterface|array|null file(string $name)

No description

Parameters

string $name

Return Value

UploadedFileInterface|array|null

files

array files()

No description

Return Value

array

isAjaxRequest

bool isAjaxRequest()

No description

Return Value

bool

ip

string|null ip()

No description

Return Value

string|null

userAgent

string|null userAgent(string|null $default = null)

No description

Parameters

string|null $default

Return Value

string|null

referer

string|null referer(string|null $default = null)

No description

Parameters

string|null $default

Return Value

string|null

method

string method()

No description

Return Value

string

isMethod

bool isMethod(HttpMethod|string $method)

No description

Parameters

HttpMethod|string $method

Return Value

bool

isGet

bool isGet()

No description

Return Value

bool

isPost

bool isPost()

No description

Return Value

bool

isPut

bool isPut()

No description

Return Value

bool

isPatch

bool isPatch()

No description

Return Value

bool

isDelete

bool isDelete()

No description

Return Value

bool

isHead

bool isHead()

No description

Return Value

bool

isOptions

bool isOptions()

No description

Return Value

bool

inputString

string inputString(string $key, string $default = '')

No description

Parameters

string $key
string $default

Return Value

string

inputInt

int inputInt(string $key, int $default = 0)

No description

Parameters

string $key
int $default

Return Value

int

inputFloat

float inputFloat(string $key, float $default = 0.0)

No description

Parameters

string $key
float $default

Return Value

float

inputBool

bool inputBool(string $key, bool $default = false)

No description

Parameters

string $key
bool $default

Return Value

bool