|
Previous Class |
Solar_Http_Response |
Next Page |
Solar_Http_Response
Generic HTTP response object for sending headers, cookies, and content.
This is a fluent class; the set() methods can be chained together like so:
<?php
$response = Solar::factory('Solar_Http_Response');
$response->setStatusCode(404)
->setHeader('X-Foo', 'Bar')
->setCookie('baz', 'dib')
->setContent('Page not found.')
->display();
?>
Catalog
This class is part of the Solar_Http package.
Inheritance:
- Solar_Base
- Solar_Http_Response
Constants
None.
Public Properties
These are all the public properties in the Solar_Http_Response class.
You can also view the list of all public, protected, and private properties.
$content- The response body content.
Public Methods
These are all the public methods in the Solar_Http_Response class.
You can also view the list of all public, protected, and private methods.
__construct()- Constructor.
__destruct()- Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().
__toString()- Sends all headers and cookies, then returns the body.
apiVersion()- Reports the API version for this class.
display()- Sends all headers and cookies, then prints the response content.
dump()- Dumps the values of this object.
getContent()- Gets the body content of the response.
getCookie()- Returns the value and options for a single cookie.
getCookies()- Returns the array of cookies that will be set by the response.
getHeader()- Returns the value of a single header.
getHeaders()- Returns the array of all headers to be sent with the response.
getStatusCode()- Returns the current status code.
getStatusText()- Returns the current status text.
getVersion()- Returns the HTTP version for this response.
locale()- Looks up class-specific locale strings based on a key.
setContent()- Sets the content of the response.
setCookie()- Sets a cookie value in $this->_cookies; will be sent to the client at display() time.
setCookiesHttponly()- By default, should cookies be sent by HTTP only?
setHeader()- Sets a header value in $this->_headers; will be sent to the client at display() time.
setStatusCode()- Sets the HTTP response status code.
setStatusText()- Sets the HTTP response status text.
setVersion()- Sets the HTTP version to '1.0' or '1.1'.
Local
- Overview
- Constants
- Properties
- Methods
- __construct()
- __destruct()
- __toString()
- _exception()
- _sendHeaders()
- apiVersion()
- display()
- dump()
- getContent()
- getCookie()
- getCookies()
- getHeader()
- getHeaders()
- getStatusCode()
- getStatusText()
- getVersion()
- locale()
- setContent()
- setCookie()
- setCookiesHttponly()
- setHeader()
- setStatusCode()
- setStatusText()
- setVersion()