Method
class Method (View source)
Methods
Create a Method instance
Defines which HTTP methods can be used to override the original method
Adds a request header as an alternative source for determining the HTTP method
Adds a parameter (request body or querystring) as an alternative source for determining the HTTP method
Get method from $_POST or $_GET or headers
Replaces $_SERVER['REQUEST_METHOD'] with the detected alternative method, using the default settings
Gets the original HTTP method of the request, before any overrides
Details
__construct(bool $reset = false)
Create a Method instance
setAllowed(array $methods)
Defines which HTTP methods can be used to override the original method
addHeader(string $header, int $priority = 0)
Adds a request header as an alternative source for determining the HTTP method
addParam(string $param, int $priority = 0)
Adds a parameter (request body or querystring) as an alternative source for determining the HTTP method
string
__toString()
Get method from $_POST or $_GET or headers
static
override()
Replaces $_SERVER['REQUEST_METHOD'] with the detected alternative method, using the default settings
static string
original()
Gets the original HTTP method of the request, before any overrides