Extbase\MVC\Web

Class Tx_Extbase_MVC_Web_Response


public class Tx_Extbase_MVC_Web_Response

A web specific response implementation

Package: Extbase
Subpackage: MVC\Web
Version: $ID:$
Scope: prototype


Method Summary

 void setStatus(integer $code, string $message=NULL)
 string getStatus()
 void setHeader(string $name, mixed $value, boolean $replaceExistingHeader=TRUE)
 string getHeaders()
 void sendHeaders()
 void send()
 void addAdditionalHeaderData(string $additionalHeaderData)
 array getAdditionalHeaderData()

Method Detail

setStatus

public void setStatus(integer $code, string $message=NULL)

Sets the HTTP status code and (optionally) a customized message.

Parameters

$code - The status code
$message - If specified, this message is sent instead of the standard message

getStatus

public string getStatus()

Returns status code and status message.

setHeader

public void setHeader(string $name, mixed $value, boolean $replaceExistingHeader=TRUE)

Sets the specified HTTP header

Parameters

$name - Name of the header, for example "Location", "Content-Description" etc.
$value - The value of the given header
$replaceExistingHeader - If a header with the same name should be replaced. Default is TRUE.

getHeaders

public string getHeaders()

Returns the HTTP headers - including the status header - of this web response

sendHeaders

public void sendHeaders()

Sends the HTTP headers.

If headers have already been sent, this method fails silently.

send

public void send()

Renders and sends the whole web response

addAdditionalHeaderData

public void addAdditionalHeaderData(string $additionalHeaderData)

Adds an additional header data (something like '<script src="myext/Resources/JavaScript/my.js" type="text/javascript"></script>' )

Parameters

$additionalHeaderData - The value additonal header

getAdditionalHeaderData

public array getAdditionalHeaderData()

Returns the additional header data