class Method (View source)

Methods

__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

Details

__construct(array $server, array $post)

Create a Method instance

Parameters

array $server
array $post

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

Parameters

array $methods

setHeader(string $header)

Set the source header to override the HTTP method. Examples:

  • x-http-method
  • x-method-override

Parameters

string $header

setParam(string $param)

Set the source parameter to override the HTTP method. Examples:

  • _HttpMethod
  • _method

Parameters

string $param

string __toString()

Get method from post param or header

Return Value

string