-
__construct() : voidRequest constructor. Fetch data from globals variables: _REQUEST, _SERVER, _POST, _GET and _FILES.
-
Check whether _REQUEST has index.
-
Check whether _POST has index.
-
Check whether _GET has index.
-
Check whether _SERVER has index.
-
Check whether _FILES has index.
-
isPost() : boolChecks whether HTTP method is POST.
-
isGet() : boolChecks whether HTTP method is GET.
-
isPut() : boolChecks whether HTTP method is PUT.
-
isPatch() : boolChecks whether HTTP method is PATCH.
-
isHead() : boolChecks whether HTTP method is HEAD.
-
isDelete() : boolChecks whether HTTP method is DELETE.
-
isOptions() : boolChecks whether HTTP method is OPTIONS.
-
isAjax() : boolChecks whether request has been made using AJAX.
-
getMethod() : stringGets HTTP method which request has been made.
-
getUserAgent() : stringGets HTTP user agent used to made the request.
-
getHTTPReferer() : stringGets web page that refers active request.
-
getClientAddress() : stringGets most possible client IPv4 Address.
-
Gets variable from _GET superglobal applying filters if needed.
-
Gets variable from _POST superglobal applying filters if needed.
-
Gets variable from _SERVER superglobal.
-
Gets variable from _FILES superglobal.
-
public function __construct()
Request constructor. Fetch data from globals variables: _REQUEST, _SERVER, _POST, _GET and _FILES. -
public function hasRequest(string $name)
Check whether _REQUEST has index. -
public function hasPost(string $name)
Check whether _POST has index. -
public function hasGet(string $name)
Check whether _GET has index. -
public function hasServer(string $name)
Check whether _SERVER has index. -
public function hasFile(string $name)
Check whether _FILES has index. -
public function isPost()
Checks whether HTTP method is POST. -
public function isGet()
Checks whether HTTP method is GET. -
public function isPut()
Checks whether HTTP method is PUT. -
public function isPatch()
Checks whether HTTP method is PATCH. -
public function isHead()
Checks whether HTTP method is HEAD. -
public function isDelete()
Checks whether HTTP method is DELETE. -
public function isOptions()
Checks whether HTTP method is OPTIONS. -
public function isAjax()
Checks whether request has been made using AJAX. -
public function getMethod()
Gets HTTP method which request has been made. -
public function getUserAgent()
Gets HTTP user agent used to made the request. -
public function getHTTPReferer()
Gets web page that refers active request. -
public function getClientAddress()
Gets most possible client IPv4 Address. -
public function getQuery(string $key, variable $filters, variable $defaultValue, bool $allowEmpty)
Gets variable from _GET superglobal applying filters if needed.If no parameters are given, return all.//Returns value from $_GET["id"] without sanitizing $id = $this->request->getQuery("id"); //Returns value from $_GET["title"] with sanitizing $title = $this->request->getQuery("title", "escape|repeats"); //Returns value from $_GET["id"] with a default value $id = $this->request->getQuery("id", null, 150);
-
public function getPost(string $key, variable $filters, variable $defaultValue, bool $allowEmpty)
Gets variable from _POST superglobal applying filters if needed.If no parameters are given, return all.//Returns value from $_POST["id"] without sanitizing $id = $this->request->getPost("id"); //Returns value from $_POST["title"] with sanitizing $title = $this->request->getPost("title", "escape|repeats"); //Returns value from $_POST["id"] with a default value $id = $this->request->getPost("id", null, 150);
-
public function getServer(string $key, variable $defaultValue)
Gets variable from _SERVER superglobal. -
public function getFiles(string $key, variable $defaultValue)
Gets variable from _FILES superglobal.