Request Interface Reference

Detailed Description

Request holds the request values that are used as input to Controller instances.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 18 of file Request.php.

+ Inheritance diagram for Request:

Public Member Functions

 setResponse (Response $response)
 
 getResponse ()
 
 initialize ($controller=null, $context=null, $action=null)
 
 getMethod ()
 
 setResponseFormat ($format)
 
 getResponseFormat ()
 
- Public Member Functions inherited from ControllerMessage
 setSender ($sender)
 
 getSender ()
 
 setContext ($context)
 
 getContext ()
 
 setAction ($action)
 
 getAction ()
 
 setFormat ($format)
 
 getFormat ()
 
 setHeader ($name, $value)
 
 setHeaders (array $headers)
 
 getHeader ($name, $default=null)
 
 getHeaders ()
 
 clearHeader ($name)
 
 clearHeaders ()
 
 hasHeader ($name)
 
 setValue ($name, $value)
 
 setValues (array $values)
 
 getValue ($name, $default=null, $validateDesc=null, $suppressException=false)
 
 getBooleanValue ($name, $default=false)
 
 getValues ()
 
 clearValue ($name)
 
 clearValues ()
 
 hasValue ($name)
 
 setProperty ($name, $value)
 
 getProperty ($name)
 
 addError (ApplicationError $error)
 
 setErrors (array $errors)
 
 getErrors ()
 
 clearErrors ()
 
 hasErrors ()
 

Member Function Documentation

◆ setResponse()

setResponse ( Response  $response)

Set the Response instance belonging to the request and vice versa.

Parameters
$responseResponse

Implemented in DefaultRequest.

◆ getResponse()

getResponse ( )

Get the Response instance belonging to the request.

Returns
Response

Implemented in DefaultRequest.

◆ initialize()

initialize (   $controller = null,
  $context = null,
  $action = null 
)

Initialize the request instance from the HTTP request.

Parameters
$controllerThe controller to call if none is given in request parameters (optional)
$contextThe context to set if none is given in request parameters (optional)
$actionThe action to perform if none is given in request parameters (optional)

Implemented in DefaultRequest.

◆ getMethod()

getMethod ( )

Get the HTTP method of the request.

Returns
String (uppercase)

Implemented in DefaultRequest.

◆ setResponseFormat()

setResponseFormat (   $format)

Set the desired response format.

Parameters
$formatA key of the configuration section 'Formats'

Implemented in DefaultRequest.

◆ getResponseFormat()

getResponseFormat ( )

Get the message response format.

If no explicit format is set, the format is derived from the Content-Type header value, if existing. If no format can be derived, the first format in the configuration key 'Formats' will be used.

Returns
String

Implemented in DefaultRequest.