Request Class

Get instance

Get the instance of the Request class:

$request = Request::getInstance();

Clear instance

Clear the instance of the Request class:

$request->clearInstance();

Init

Init the class:

$request->init();

Globals

Get item from globals:

$request->get(string $key, string $index);

Set item to globals:

$request->set(string $key, mixed $value);

Server

Get item from server:

$request->getServer(string $key);

Set item to server:

$request->setServer(string $key, mixed $value);

Query

Get item from query:

$request->getQuery(string $key);

Set item to query:

$request->setQuery(string $key, mixed $value);

Post

Get item from post:

$request->getPost(string $key);

Set item to post:

$request->setPost(string $key, mixed $value);

Files

Get item from files:

$request->getFiles(string $key);

Set item to files:

$request->setFiles(string $key, mixed $value);

Session

Get item from session:

$request->getSession(string $key);

Set item to session:

$request->setSession(string $key, mixed $value);

Refresh the session:

$request->refreshSession();

Cookie

Get item from cookie:

$request->getCookie(string $key);

Set item to cookie:

$request->setCookie(string $key, mixed $value);

Refresh the cookie:

$request->refreshCookie();
Edit on GitHub