PHP Class r, kirby

Inheritance: extends FireKit\Database\ActiveRecord\ActiveRecord
Show file Open project: bastianallgeier/kirby Class Usage Examples

Public Methods

Method Description
body ( ) : array Returns the request body from POST requests for example
data ( ) fetch all data from the request and sanitize it
get ( mixed $key = false, mixed $default = null ) : mixed Gets a request value by key
is_ajax ( ) : boolean Checks if the current request is an AJAX request
is_delete ( ) : boolean Checks if the current request is a DELETE request
is_get ( ) : boolean Checks if the current request is a GET request
is_post ( ) : boolean Checks if the current request is a POST request
is_put ( ) : boolean Checks if the current request is a PUT request
method ( ) : string Returns the current request method
referer ( string $default = null ) : string Returns the HTTP_REFERER
sanitize ( array $data ) : array Sanitizes the incoming data
set ( mixed $key, mixed $value = null ) Sets a request value by key

Method Details

body() static public method

Returns the request body from POST requests for example
static public body ( ) : array
return array

data() static public method

fetch all data from the request and sanitize it
static public data ( )

get() static public method

Gets a request value by key
static public get ( mixed $key = false, mixed $default = null ) : mixed
$key mixed The key to look for. Pass false or null to return the entire request array.
$default mixed Optional default value, which should be returned if no element has been found
return mixed

is_ajax() static public method

Checks if the current request is an AJAX request
static public is_ajax ( ) : boolean
return boolean

is_delete() static public method

Checks if the current request is a DELETE request
static public is_delete ( ) : boolean
return boolean

is_get() static public method

Checks if the current request is a GET request
static public is_get ( ) : boolean
return boolean

is_post() static public method

Checks if the current request is a POST request
static public is_post ( ) : boolean
return boolean

is_put() static public method

Checks if the current request is a PUT request
static public is_put ( ) : boolean
return boolean

method() static public method

Returns the current request method
static public method ( ) : string
return string POST, GET, DELETE, PUT

referer() static public method

Returns the HTTP_REFERER
static public referer ( string $default = null ) : string
$default string Define a default URL if no referer has been found
return string

sanitize() static public method

Sanitizes the incoming data
static public sanitize ( array $data ) : array
$data array
return array

set() static public method

Sets a request value by key
static public set ( mixed $key, mixed $value = null )
$key mixed The key to define
$value mixed The value for the passed key