\Request

Handle the HTTP requests

Summary

Methods
Properties
Constants
__constructStatic()
get()
getParam()
postParam()
getRequestObject()
getRequestURI()
isGET()
isPOST()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$request
$requestURI
$isGET
$isPOST
N/A

Properties

$request

$request : 

The Symfony Request object

Type

$requestURI

$requestURI : 

The original value of $_SERVER["REQUEST_URI"] before it's altered

Type

$isGET

$isGET : 

Whether request is GET

Type

$isPOST

$isPOST : 

Whether request is POST

Type

Methods

__constructStatic()

__constructStatic() 

Set up class

get()

get(string  $key, string  $default = null) : string|null

Get value from $_GET & $_POST

Parameters

string $key

The key of $_GET or $_POST

string $default

The default value if param doesn't exist in GET or POST data

Returns

string|null —

Null if the param doesn't exist in both GET and POST data

getParam()

getParam(string  $key, string  $default = null) : string

Get value from $_GET

Parameters

string $key

The key of $_GET

string $default

The default value if GET param doesn't exist

Returns

string —

The GET param or default value

postParam()

postParam(string  $key, string  $default = null) : string

Get POST data

Parameters

string $key

The key of $_POST

string $default

The default value if POST param doesn't exist

Returns

string —

The POST param or default value

getRequestObject()

getRequestObject() : \Symfony\Component\HttpFoundation\Request

Get the Symfony Request object used by this class

Returns

\Symfony\Component\HttpFoundation\Request —

Symfony's Request Object

getRequestURI()

getRequestURI() : string

Get the original $_SERVER["REQUEST_URI"]

Returns

string —

The value that was originally in $_SERVER["REQUEST_URI"] before it was altered

isGET()

isGET() : boolean

Check if it is a GET request

Returns

boolean —

Whether the request has GET data

isPOST()

isPOST() : boolean

Check if it is a POST request

Returns

boolean —

Whether the request has POST data