Method
class Method (View source)
Methods
Create a Method instance
Replaces $_SERVER['REQUEST_METHOD'] with the detected alternative method
and create $_SERVER['REQUEST_METHOD_ORIGINAL'] with original method
Set which HTTP methods can be used to override the original method
Set the source header to override the HTTP method. Examples:
- x-http-method
- x-method-override
Set the source parameter to override the HTTP method. Examples:
- _HttpMethod
- _method
Get method from post param or header
Details
__construct(array $server, array $post)
Create a Method instance
static
override()
Replaces $_SERVER['REQUEST_METHOD'] with the detected alternative method
and create $_SERVER['REQUEST_METHOD_ORIGINAL'] with original method
setAllowed(array $methods)
Set which HTTP methods can be used to override the original method
setHeader(string $header)
Set the source header to override the HTTP method. Examples:
- x-http-method
- x-method-override
setParam(string $param)
Set the source parameter to override the HTTP method. Examples:
- _HttpMethod
- _method
string
__toString()
Get method from post param or header