Request
in package
Weaver Framework - Request Class
This class provides common functionality for handling inputs like $_POST, $_GET & $_FILES.
Table of Contents
Methods
- fileHandle() : mixed|null
- Get the file handle from the $_FILES superglobal.
- get() : mixed
- Get a value from the GET request.
- post() : mixed
- Get a value from the POST request.
Methods
fileHandle()
Get the file handle from the $_FILES superglobal.
public
static fileHandle(string $key[, mixed $default = null ]) : mixed|null
This method retrieves the file handle associated with the specified key from the $_FILES superglobal array. If the key is not found, it returns the provided default value.
Parameters
- $key : string
-
The key to look up in the $_FILES array.
- $default : mixed = null
-
(Optional) The default value to return if the key is not found. Default is null.
Return values
mixed|null —The file handle if found, or the default value if not found.
get()
Get a value from the GET request.
public
static get(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
-
The key of the value to retrieve.
- $default : mixed = null
-
The default value to return if the key is not found.
Return values
mixed —The value from the GET request or the default value if not found.
post()
Get a value from the POST request.
public
static post(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
-
The key of the value to retrieve.
- $default : mixed = null
-
The default value to return if the key is not found.
Return values
mixed —The value from the POST request or the default value if not found.