Abstract Class Zend_Controller_Response_Abstract

Description

Zend_Controller_Response_Abstract

Base class for Zend_Controller responses

Located in /Controller/Response/Abstract.php (line 32)


	
			
Direct descendents
Class Description
 class Zend_Controller_Response_Http Zend_Controller_Response_Http
 class Zend_Controller_Response_Cli Zend_Controller_Response_Cli
Variable Summary
Method Summary
 Zend_Controller_Response_Abstract append (string $name, string $content)
 Zend_Controller_Response_Abstract appendBody (string $content, [null|string $name = null])
 boolean canSendHeaders ([boolean $throw = false])
 boolean clearBody ([string $name = null])
 string|array|null getBody ([boolean $spec = false])
 array getException ()
 void getExceptionByCode (mixed $code)
 false|array getExceptionByMessage (string $message)
 false|array getExceptionByType (string $type)
 array getHeaders ()
 array getRawHeaders ()
 boolean hasExceptionOfCode (int $code)
 boolean hasExceptionOfMessage (string $message)
 boolean hasExceptionOfType (string $type)
 Zend_Controller_Response_Abstract insert (string $name, string $content, [string $parent = null], [boolean $before = false])
 boolean isException ()
 boolean isRedirect ()
 void outputBody ()
 void prepend (string $name, string $content)
 boolean renderExceptions ([boolean $flag = null])
 void sendResponse ()
 Zend_Controller_Response_Abstract setBody (string $content, [null|string $name = null])
 Zend_Controller_Response_Abstract setHeader (string $name, string $value, [boolean $replace = false])
 Zend_Controller_Response_Abstract setRedirect (string $url, [int $code = 302])
 string _normalizeHeader (string $name)
 string __toString ()
Variables
boolean $headersSentThrowsException = true (line 84)

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.


Redefined in descendants as:
array $_body = array() (line 38)

Body content

  • access: protected
Exception $_exceptions = array() (line 44)

Exception stack

  • access: protected
array $_headers = array() (line 50)

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

  • access: protected
array $_headersRaw = array() (line 56)

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 $_isRedirect = false (line 68)

Flag; is this response a redirect?

  • access: protected
boolean $_renderExceptions = false (line 74)

Whether or not to render exceptions; off by default

  • access: protected
Methods
append (line 483)

Append a named body segment to the body content array

If segment already exists, replaces with $content and places at end of array.

  • access: public
Zend_Controller_Response_Abstract append (string $name, string $content)
  • string $name
  • string $content
appendBody (line 404)

Append content to the body content

  • access: public
Zend_Controller_Response_Abstract appendBody (string $content, [null|string $name = null])
  • string $content
  • null|string $name
canSendHeaders (line 316)

Can we send headers?

  • throws: Zend_Controller_Response_Exception
  • access: public
boolean canSendHeaders ([boolean $throw = false])
  • boolean $throw: Whether or not to throw an exception if headers have been sent; defaults to false

Redefined in descendants as:
clearAllHeaders (line 270)

Clear all headers, normal and raw

  • access: public
clearBody (line 431)

Clear body array

With no arguments, clears the entire body array. Given a $name, clears just that named segment; if no segment matching $name exists, returns false to indicate an error.

  • access: public
boolean clearBody ([string $name = null])
  • string $name: Named segment to clear
clearHeader (line 193)

Clears the specified HTTP header

  • access: public
Zend_Controller_Response_Abstract clearHeader (string $name)
  • string $name
clearHeaders (line 180)

Clear headers

  • access: public
clearRawHeader (line 253)

Clears the specified raw HTTP header

  • access: public
Zend_Controller_Response_Abstract clearRawHeader (string $headerRaw)
  • string $headerRaw
clearRawHeaders (line 241)

Clear all setRawHeader()

  • access: public
getBody (line 458)

Return the body content

If $spec is false, returns the concatenated values of the body content array. If $spec is boolean true, returns the body content array. If $spec is a string and matches a named segment, returns the contents of that segment; otherwise, returns null.

  • access: public
string|array|null getBody ([boolean $spec = false])
  • boolean $spec

Redefined in descendants as:
getException (line 606)

Retrieve the exception stack

  • access: public
array getException ()
getExceptionByCode (line 723)

Retrieve all exceptions of a given code

  • access: public
void getExceptionByCode (mixed $code)
  • mixed $code
getExceptionByMessage (line 701)

Retrieve all exceptions of a given message

  • access: public
false|array getExceptionByMessage (string $message)
  • string $message
getExceptionByType (line 679)

Retrieve all exceptions of a given type

  • access: public
false|array getExceptionByType (string $type)
  • string $type
getHeaders (line 170)

Return array of headers; see $_headers for format

  • access: public
array getHeaders ()
getHttpResponseCode (line 304)

Retrieve HTTP response code

  • access: public
int getHttpResponseCode ()
getRawHeaders (line 231)

Retrieve all setRawHeader()

  • access: public
array getRawHeaders ()
hasExceptionOfCode (line 661)

Does the response object contain an exception with a given code?

  • access: public
boolean hasExceptionOfCode (int $code)
  • int $code
hasExceptionOfMessage (line 644)

Does the response object contain an exception with a given message?

  • access: public
boolean hasExceptionOfMessage (string $message)
  • string $message
hasExceptionOfType (line 627)

Does the response object contain an exception of a given type?

  • access: public
boolean hasExceptionOfType (string $type)
  • string $type
insert (line 534)

Insert a named segment into the body content array

  • access: public
Zend_Controller_Response_Abstract insert (string $name, string $content, [string $parent = null], [boolean $before = false])
  • string $name
  • string $content
  • string $parent
  • boolean $before: Whether to insert the new segment before or after the parent. Defaults to false (after)
isException (line 616)

Has an exception been registered with the response?

  • access: public
boolean isException ()
isRedirect (line 160)

Is this a redirect?

  • access: public
boolean isRedirect ()
outputBody (line 583)

Echo the body segments

  • access: public
void outputBody ()

Redefined in descendants as:
prepend (line 507)

Prepend a named body segment to the body content array

If segment already exists, replaces with $content and places at top of array.

  • access: public
void prepend (string $name, string $content)
  • string $name
  • string $content
renderExceptions (line 749)

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 335)

Send all headers

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

  • access: public

Redefined in descendants as:
sendResponse (line 764)

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

  • access: public
void sendResponse ()

Redefined in descendants as:
setBody (line 386)

Set body content

If $name is not passed, or is not a string, resets the entire body and sets the 'default' key to $content.

If $name is a string, sets the named segment in the body array to $content.

  • access: public
Zend_Controller_Response_Abstract setBody (string $content, [null|string $name = null])
  • string $content
  • null|string $name
setException (line 595)

Register an exception with the response

  • access: public
Zend_Controller_Response_Abstract setException ( $e)
  • Exception $e
setHeader (line 113)

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 282)

Set HTTP response code to use with headers

  • access: public
Zend_Controller_Response_Abstract setHttpResponseCode (int $code)
  • int $code
setRawHeader (line 216)

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 146)

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
_normalizeHeader (line 94)

Normalize a header name

Normalizes a header name to X-Capitalized-Names

  • access: protected
string _normalizeHeader (string $name)
  • string $name
__toString (line 788)

Magic __toString functionality

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

  • access: public
string __toString ()

Redefined in descendants as:

Documentation generated on Mon, 21 Jun 2010 15:05:31 -0400 by phpDocumentor 1.4.3