Requests
Requests are HTTP messages and/or data recevied by web server from different sources.
In the Quantum framework requets are handled with Request
class, which extends the base HttpRequest
class. Requests can come to server in different methods (GET, POST, PUT, DELETE) so they should be handled appropriately. The Request
class has all the necessary methods to handle each request correctly.
Request::get($key [, $default])
- Returns a parameter by given key, sent by GET methodRequest::post($key [, $default])
- Returns a parameter by given key, sent by POST methodRequest::any($key)
- Returns a parameter by given key, sent by any of methodsRequest::all()
- Returns all the request parameters as arrayRequest::getHeaders()
- Returns all the headers as arrayRequest::getCSRFToken()
- Gets the Сross Site Request Forgery TokenRequest::getAllSegments()
- Gets all the segments of current URIRequest::getSegment($number)
- Gets the nth segment of current URIRequest::getCurrentRoute()
- Returns the current routeRequest::hasFile($key)
- Checks to see if request contains fileRequest::isAjax()
- Checks to see if request was ajax request