Oihana PHP Enums

HttpParamStrategy uses ConstantsTrait

Defines the strategy used to retrieve parameters from an HTTP request.

This class provides three strategies:

The ConstantsTrait can be used to enumerate or validate these strategies.

Example:

if ($strategy === HttpParamStrategy::BODY)
{
    // Retrieve parameters only from the body
}

Table of Contents

Constants

BODY  : string = 'body'
Retrieve parameters from the request body only.
BOTH  : string = 'both'
Retrieve parameters from both the request body and the query string.
QUERY  : string = 'query'
Retrieve parameters from the query string only.

Constants

BODY

Retrieve parameters from the request body only.

public string BODY = 'body'

BOTH

Retrieve parameters from both the request body and the query string.

public string BOTH = 'both'

QUERY

Retrieve parameters from the query string only.

public string QUERY = 'query'
On this page

Search results