class Input

Input class handles requests to the server.

Methods

bool
csrfCheck()

Checks csrf token to determine if it was tampered with. If the check fails the user is routed to a view stating access is restricted.

array|string
get(string|null $input = null)

Supports operations related to handling POST and GET requests.

string
getRequestMethod()

Returns the request element within the $_SERVER superglobal array.

bool
isGet()

Checks if the REQUEST_METHOD is GET.

bool
isPost()

Checks if the REQUEST_METHOD is POST.

bool
isPut()

Checks if the REQUEST_METHOD is PUT.

Details

at line 18
bool csrfCheck()

Checks csrf token to determine if it was tampered with. If the check fails the user is routed to a view stating access is restricted.

Return Value

bool

Returns true if check passes.

at line 30
array|string get(string|null $input = null)

Supports operations related to handling POST and GET requests.

Parameters

string|null $input

Field name from POST/GET request, or null to get all

Return Value

array|string

Sanitized input as array or string

at line 65
string getRequestMethod()

Returns the request element within the $_SERVER superglobal array.

Return Value

string

The type of request stored in the REQUEST_METHOD element within the $_SERVER superglobal array.

at line 74
bool isGet()

Checks if the REQUEST_METHOD is GET.

Return Value

bool

True if the request method is GET.

at line 83
bool isPost()

Checks if the REQUEST_METHOD is POST.

Return Value

bool

True if the request method is POST.

at line 92
bool isPut()

Checks if the REQUEST_METHOD is PUT.

Return Value

bool

True if the request method is PUT.