Request
The Request Utility is a object-oriented representation of the current http request and user inputs. It is used to get information about the current http request in a concise and comprehensible way. It acts as a facade for both PHP superarrays. It even executes some pre-validation on inputs.
To access the request utility, you must import the Request
class from the Core
module.
use Apine\Core\Request;
if (!Request::is_api_call()) {
if (!empty(Request::get()['request']) && Request::get()['request'] != '/') {
$request = Request::get()['request'];
} else {
$request = '/index';
}
if (Request::is_get()) {
// Do something if the HTTP verb is GET
} else if (Request::is_post()) {
// Do something else if the verb is POST
}
}
Returns weither the current http request is a GET request or not
Returns weither the current http request is a POST request or not
Returns weither the current http request is a PUT request or not
Returns weither the current http request is a DELETE request or not
Return the type of the current http request
Return the port used by the user in the current request
Return headers received from the current request
Return the raw body from the current request
Checks if the request is made through the HTTPS protocol
Checks if the request is made to the API
Checks if the request is made from a ajax client
Return GET input
Return POST input
Return uploaded file input
Return Request information
Return server information
Return an aggregate of all the input that are sent directly to the controllers through the routing procedure
- Introduction
- Getting Started
- Requirements & Installation
- Application Configuration
- Database Connection
- How to use Controllers
- How to use Views
- How to Manage Session
- How to use the api (Coming Soon)
- Utilities
- Entity Manager
- File Manager
- Access and Save File (Coming Soon)
- Image Methods (Coming Soon)
- XML Manager
- XML Class (Coming Soon)
- Parser (Coming Soon)
- Writer (Coming Soon)
- Advanced Topics
- Extended Users
- Routes
- Templating (Coming Soon)
- Translations and Locales