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 = 200
HTTP response code to use in headers
Default value200
Details- Type
- int
boolean $_isRedirect = false
Flag; is this response a redirect?
Default valuefalse
Details- Type
- boolean
boolean $_renderExceptions = false
Whether or not to render exceptions; off by default
Default valuefalse
Details- Type
- boolean
boolean $headersSentThrowsException = true
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.
Default valuetrue
Details- Type
- boolean
- See
-
Methods
__toString() : string
Magic __toString functionality
Proxies to {@link sendResponse()} and returns response value as string
using output buffering.
Returnsappend(string $name, string $content) : \Zend_Controller_Response_Abstract
Append a named body segment to the body content array
If segment already exists, replaces with $content and places at end of
array.
ParametersName | Type | Description |
---|
$name | string | |
---|
$content | string | |
---|
ReturnsappendBody(string $content, null | string $name = null) : \Zend_Controller_Response_Abstract
Append content to the body content
ParametersName | Type | Description |
---|
$content | string | |
---|
$name | null | string | |
---|
Returns canSendHeaders(boolean $throw = false) : boolean
ParametersName | Type | Description |
---|
$throw | boolean | Whether or not to throw an exception if headers have been sent; defaults to false |
---|
ReturnsThrows clearBody(string $name = null) : boolean
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.
ParametersName | Type | Description |
---|
$name | string | Named segment to clear |
---|
ReturnsgetExceptionByCode(mixed $code) : void
Retrieve all exceptions of a given code
ParametersName | Type | Description |
---|
$code | mixed | |
---|
getExceptionByMessage(string $message) : false | array
Retrieve all exceptions of a given message
ParametersName | Type | Description |
---|
$message | string | |
---|
ReturnsType | Description |
---|
false | array | |
getExceptionByType(string $type) : false | array
Retrieve all exceptions of a given type
ParametersName | Type | Description |
---|
$type | string | |
---|
ReturnsType | Description |
---|
false | array | |
hasExceptionOfCode(int $code) : boolean
Does the response object contain an exception with a given code?
ParametersName | Type | Description |
---|
$code | int | |
---|
Returns hasExceptionOfMessage(string $message) : boolean
Does the response object contain an exception with a given message?
ParametersName | Type | Description |
---|
$message | string | |
---|
Returns hasExceptionOfType(string $type) : boolean
Does the response object contain an exception of a given type?
ParametersName | Type | Description |
---|
$type | string | |
---|
Returns insert(string $name, string $content, string $parent = null, boolean $before = false) : \Zend_Controller_Response_Abstract
Insert a named segment into the body content array
ParametersName | 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) : void
Prepend a named body segment to the body content array
If segment already exists, replaces with $content and places at top of
array.
ParametersName | Type | Description |
---|
$name | string | |
---|
$content | string | |
---|
renderExceptions(boolean $flag = null) : boolean
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.
ParametersName | Type | Description |
---|
$flag | boolean | Optional |
---|
Returns