Controller/Response/Abstract.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Controller
- Version
- $Id$
\Zend_Controller_Response_Abstract
Package: Zend_Controller\ResponseZend_Controller_Response_Abstract
Base class for Zend_Controller responses
- Children
- \Zend_Controller_Response_Http
- \Zend_Controller_Response_Cli
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties



array $_headers = array()Array of headers. Each header is an array with keys 'name' and 'value'
Default valuearray()Details- Type
- array



array $_headersRaw = array()Array of raw headers. Each header is a single string, the entire header to emit
Default valuearray()Details- Type
- array



int $_httpResponseCode = 200HTTP response code to use in headers
Default value200Details- Type
- int



boolean $_isRedirect = falseFlag; is this response a redirect?
Default valuefalseDetails- Type
- boolean



boolean $_renderExceptions = falseWhether or not to render exceptions; off by default
Default valuefalseDetails- Type
- boolean



boolean $headersSentThrowsException = trueFlag; 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.
Default valuetrueDetails- Type
- boolean
- See
-
Methods



__toString() : stringMagic __toString functionality
Proxies to {@link sendResponse()} and returns response value as string
using output buffering.
Returns


append(string $name, string $content) : \Zend_Controller_Response_AbstractAppend a named body segment to the body content array
If segment already exists, replaces with $content and places at end of
array.
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
| $content | string | |
|---|
Returns


appendBody(string $content, null | string $name = null) : \Zend_Controller_Response_AbstractAppend content to the body content
Parameters| Name | Type | Description |
|---|
| $content | string | |
|---|
| $name | null | string | |
|---|
Returns 


canSendHeaders(boolean $throw = false) : booleanParameters| Name | Type | Description |
|---|
| $throw | boolean | Whether or not to throw an exception if headers have been sent; defaults to false |
|---|
ReturnsThrows 


clearBody(string $name = null) : booleanWith 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.
Parameters| Name | Type | Description |
|---|
| $name | string | Named segment to clear |
|---|
Returns


getExceptionByCode(mixed $code) : voidRetrieve all exceptions of a given code
Parameters| Name | Type | Description |
|---|
| $code | mixed | |
|---|



getExceptionByMessage(string $message) : false | arrayRetrieve all exceptions of a given message
Parameters| Name | Type | Description |
|---|
| $message | string | |
|---|
Returns| Type | Description |
|---|
| false | array | |



getExceptionByType(string $type) : false | arrayRetrieve all exceptions of a given type
Parameters| Name | Type | Description |
|---|
| $type | string | |
|---|
Returns| Type | Description |
|---|
| false | array | |



hasExceptionOfCode(int $code) : booleanDoes the response object contain an exception with a given code?
Parameters| Name | Type | Description |
|---|
| $code | int | |
|---|
Returns 


hasExceptionOfMessage(string $message) : booleanDoes the response object contain an exception with a given message?
Parameters| Name | Type | Description |
|---|
| $message | string | |
|---|
Returns 


hasExceptionOfType(string $type) : booleanDoes the response object contain an exception of a given type?
Parameters| Name | Type | Description |
|---|
| $type | string | |
|---|
Returns 


insert(string $name, string $content, string $parent = null, boolean $before = false) : \Zend_Controller_Response_AbstractInsert a named segment into the body content array
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
| $content | string | |
|---|
| $parent | string | |
|---|
| $before | boolean | Whether to insert the new segment before or
after the parent. Defaults to false (after) |
|---|
Returns 


prepend(string $name, string $content) : voidPrepend a named body segment to the body content array
If segment already exists, replaces with $content and places at top of
array.
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
| $content | string | |
|---|



renderExceptions(boolean $flag = null) : booleanWhether 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.
Parameters| Name | Type | Description |
|---|
| $flag | boolean | Optional |
|---|
Returns