## Zend_Controller_Response_Abstract

Description

Zend_Controller_Response_Abstract

Base class for Zend_Controller responses

- usedby: Zend_Controller_Response_Http
- usedby: Zend_Controller_Response_Cli
- abstract:
- license: New BSD License
- copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Controller/Response/Abstract.php (line 31)

Direct descendents

Class | Description
--- | ---
Zend_Controller_Response_Cli | Zend_Controller_Response_Cli
Zend_Controller_Response_Http | Zend_Controller_Response_Http

Variable Summary
boolean $headersSentThrowsException
array $_body
Exception $_exceptions
array $_headers
array $_headersRaw
int $_httpResponseCode
boolean $_renderExceptions
Method Summary
Zend_Controller_Response_Abstract appendBody (string $content)
boolean canSendHeaders ([boolean $throw = false])
Zend_Controller_Response_Abstract clearAllHeaders ()
Zend_Controller_Response_Abstract clearHeaders ()
Zend_Controller_Response_Abstract clearRawHeaders ()
string|array getBody ([boolean $asArray = false])
array getException ()
array getHeaders ()
int getHttpResponseCode ()
array getRawHeaders ()
boolean isException ()
void outputBody ()
boolean renderExceptions ([boolean $flag = null])
Zend_Controller_Response_Abstract sendHeaders ()
void sendResponse ()
Zend_Controller_Response_Abstract setBody (string $content)
Zend_Controller_Response_Abstract setException ( $e)
Zend_Controller_Response_Abstract setHeader (string $name, string $value, [boolean $replace = false])
Zend_Controller_Response_Abstract setHttpResponseCode (int $code)
Zend_Controller_Response_Abstract setRawHeader (string $value)
Zend_Controller_Response_Abstract setRedirect (string $url, [int $code = 302])
string __toString ()
Variables
boolean $headersSentThrowsException = true (line 78)

Flag; if true, when header operations are called after headers have been sent, an exception will be raised; otherwise, processing will continue as normal. Defaults to true.

- access: public
- see: Zend_Controller_Response_Abstract::canSendHeaders()

Redefined in descendants as:

- Zend_Controller_Response_Cli::$headersSentThrowsException : Flag; if true, when header operations are called after headers have been sent, an exception will be raised; otherwise, processing will continue as normal. Defaults to false.

array $_body = array() (line 37)

Body content

- access: protected

Exception $_exceptions = array() (line 43)

Exception stack

- access: protected

array $_headers = array() (line 49)

Array of headers. Each header is an array with keys 'name' and 'value'

- access: protected

array $_headersRaw = array() (line 55)

Array of raw headers. Each header is a single string, the entire header to emit

- access: protected

int $_httpResponseCode = 200 (line 62)

HTTP response code to use in headers

- access: protected

boolean $_renderExceptions = false (line 68)

Whether or not to render exceptions; off by default

- access: protected

Methods
appendBody (line 312)

Append content to the body content

- access: public

Zend_Controller_Response_Abstract appendBody (string $content)

- string $content

canSendHeaders (line 235)

Can we send headers?

- access: public
- throws: Zend_Controller_Response_Exception

boolean canSendHeaders ([boolean $throw = false])

- boolean $throw: Whether or not to throw an exception if headers have been sent; defaults to false

clearAllHeaders (line 195)

Clear all headers, normal and raw

- access: public

Zend_Controller_Response_Abstract clearAllHeaders ()
clearHeaders (line 147)

Clear headers

- access: public

Zend_Controller_Response_Abstract clearHeaders ()
clearRawHeaders (line 184)

Clear all setRawHeader()

- access: public

Zend_Controller_Response_Abstract clearRawHeaders ()
getBody (line 325)

Return the body content

- access: public

string|array getBody ([boolean $asArray = false])

- boolean $asArray: Whether or not to return the body content as an array of strings or as a single string; defaults to false

getException (line 365)

Retrieve the exception stack

- access: public

array getException ()
getHeaders (line 137)

Return array of headers; see $_headers for format

- access: public

array getHeaders ()
getHttpResponseCode (line 223)

Retrieve HTTP response code

- access: public

int getHttpResponseCode ()
getRawHeaders (line 174)

Retrieve all setRawHeader()

- access: public

array getRawHeaders ()
isException (line 375)

Has an exception been registered with the response?

- access: public

boolean isException ()
outputBody (line 341)

Echo the body segments

- access: public

void outputBody ()
renderExceptions (line 389)

Whether or not to render exceptions (off by default)

If called with no arguments or a null argument, returns the value of the flag; otherwise, sets it and returns the current value.

- access: public

boolean renderExceptions ([boolean $flag = null])

- boolean $flag: Optional

sendHeaders (line 254)

Send all headers

Sends any headers specified. If an HTTP response code has been specified, it is sent with the first header.

- access: public

Zend_Controller_Response_Abstract sendHeaders ()
sendResponse (line 404)

Send the response, including all headers, rendering exceptions if so requested.

- access: public

void sendResponse ()
setBody (line 300)

Set body content

If body content already defined, this will replace it.

- access: public

Zend_Controller_Response_Abstract setBody (string $content)

- string $content

setException (line 354)

Register an exception with the response

- access: public

Zend_Controller_Response_Abstract setException ( $e)

- Exception $e

setHeader (line 91)

Set a header

If $replace is true, replaces any headers already defined with that $name.

- access: public

Zend_Controller_Response_Abstract setHeader (string $name, string $value, [boolean $replace = false])

- string $name
- string $value
- boolean $replace

setHttpResponseCode (line 207)

Set HTTP response code to use with headers

- access: public

Zend_Controller_Response_Abstract setHttpResponseCode (int $code)

- int $code

setRawHeader (line 162)

Set raw HTTP header

Allows setting non key => value headers, such as status codes

- access: public

Zend_Controller_Response_Abstract setRawHeader (string $value)

- string $value

setRedirect (line 123)

Set redirect URL

Sets Location header and response code. Forces replacement of any prior redirects.

- access: public

Zend_Controller_Response_Abstract setRedirect (string $url, [int $code = 302])

- string $url
- int $code

__toString (line 428)

Magic __toString functionality

Proxies to sendResponse() and returns response value as string using output buffering.

- access: public

string __toString ()

Redefined in descendants as:

- Zend_Controller_Response_Cli::__toString() : Magic __toString functionality

Documentation generated on Wed, 21 Feb 2007 11:45:13 -0800 by phpDocumentor 1.3.1