\Disco\classesRequest

Information about the current request to the application.

Summary

Methods
Properties
Constants
__construct()
uri()
type()
ip()
secure()
scheme()
host()
port()
user()
pass()
path()
pathPart()
pathDepth()
query()
fragment()
get()
post()
put()
delete()
data()
getServerGlobal()
getRequestGlobal()
No public properties found
No constants found
No protected methods found
$uri
$url
$pathParts
$type
$ip
$secure
N/A
No private methods found
No private properties found
N/A

Properties

$uri

$uri : string

Type

string — The request URI.

$url

$url : string

Type

string — The request URL.

$pathParts

$pathParts : array

Type

array — The parts of the request URI.

$type

$type : string

Type

string — The request type/method, eg: `POST,GET,DELETE,PUT`.

$ip

$ip : string

Type

string — The IP address of the user making the request.

$secure

$secure : boolean

Type

boolean — Whether the request was made over HTTPS.

Methods

__construct()

__construct() 

Pull necessary information from $_SERVER and make available on the class.

uri()

uri() : string

Get the request URI.

Returns

string

type()

type() : string

Get the request type.

Returns

string

ip()

ip() : string

Get the request IP address.

Returns

string

secure()

secure() : boolean

Whether the request was made via HTTPS.

Returns

boolean

scheme()

scheme() : string

Get the url schema of the request.

Returns

string

host()

host() : string

Get the url host of the request.

Returns

string

port()

port() : string

Get the port of the request.

Returns

string

user()

user() : string

Get the user of the request.

Returns

string

pass()

pass() : string

Get the password of the request.

Returns

string

path()

path() : string

Get the path of the request. The string after the domain backslash and before any get variables.

Returns

string

pathPart()

pathPart(integer  $i) : string

Get a part of the path by index.

Parameters

integer $i

The index of the path part.

Returns

string

pathDepth()

pathDepth() : integer

Get the depth of the path.

Returns

integer

query()

query() : string

Get the query of the path.

Returns

string

fragment()

fragment() : string

Get the framgment of the path.

Returns

string

get()

get(string  $k = null) : string

Get a GET variable in the request.

Parameters

string $k

The key.

Returns

string

post()

post(string  $k = null) : string

Get a POST variable in the request.

Parameters

string $k

The key.

Returns

string

put()

put(string  $k = null) : string

Get a PUT variable in the request.

Parameters

string $k

The key.

Returns

string

delete()

delete(string  $k = null) : string

Get a DELETE variable in the request.

Parameters

string $k

The key.

Returns

string

data()

data() : \Disco\classes\Data

Get an instance of the \Disco\classes\Data service.

Returns

\Disco\classes\Data

getServerGlobal()

getServerGlobal() : array

Get the `$_SERVER` superglobal. Comes in handy when you want access to the server superglobal via Twig templates.

Returns

array

getRequestGlobal()

getRequestGlobal() : array

Get the `$_REQUEST` superglobal. Comes in handy when you want access to the request superglobal via Twig templates.

Returns

array