-
Notifications
You must be signed in to change notification settings - Fork 1
Request
The ApineRequest
class 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 manage some pre-validation on inputs.
if (!ApineRequest::is_api_call()) {
if (!empty(ApineRequest::get()['request']) && ApineRequest::get()['request'] != '/') {
$request = ApineRequest::get()['request'];
} else {
$request = '/index';
}
if (ApineRequest::is_get()) {
// Do something if the HTTP verb is GET
} else if (ApineRequest::is_post()) {
// Do something else if the verb is POST
}
}
static is_get() : bool
Returns weither the current http request is a GET request or not
static is_post() : bool
Returns weither the current http request is a POST request or not
static is_put() : bool
Returns weither the current http request is a PUT request or not
static is_delete() : bool
Returns weither the current http request is a DELETE request or not
static get_request_type() : string
Return the type of the current http request
static get_request_port() : integer
Return the port used by the user in the current request
static get_request_headers() : array
Return headers received from the current request
static is_https() : bool
Checks if the request is made through the HTTPS protocol
static is_api_call() : bool
Checks if the request is made to the API
static is_ajax() : bool
Checks if the request is made from a ajax client
static get() : array
Return GET input
static post() : array
Return POST input
static files() : array
Return uploaded file input
static request() : array
Return Request information
static server() : array
Return server information
- 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