
Public Member Functions | |
| __construct ($content='', $mimetype=null) | |
| render ($output_body=true) | |
| outputHeaders () | |
Public Attributes | |
| $content = '' | |
| $headers = array() | |
| $status_code = 200 | |
| $cookies = array() | |
| $status_code_list | |
When constructing a view, the response object must be populated and returned. The response is then displayed to the visitor. The interest of using a response object is that we can run a post filter action on the response. For example you can run a filter that is checking that all the output is valid HTML and write a logfile if this is not the case.
| Pluf_HTTP_Response::__construct | ( | $ | content = '', |
|
| $ | mimetype = null | |||
| ) |
Constructor of the response.
| string | Content of the response ('') | |
| string | MimeType of the response (null) if not given will default to the one given in the configuration 'mimetype' |
Reimplemented in Pluf_HTTP_Response_CommandPassThru, Pluf_HTTP_Response_Json, Pluf_HTTP_Response_Redirect, Pluf_HTTP_Response_RedirectToLogin, Pluf_HTTP_Response_ServerError, and Pluf_HTTP_Response_ServerErrorDebug.
| Pluf_HTTP_Response::render | ( | $ | output_body = true |
) |
Render a response object.
Reimplemented in Pluf_HTTP_Response_CommandPassThru, and Pluf_HTTP_Response_File.
| Pluf_HTTP_Response::outputHeaders | ( | ) |
Output headers.
| Pluf_HTTP_Response::$content = '' |
Content of the response.
| Pluf_HTTP_Response::$headers = array() |
Array of the headers to add.
For example $this->headers['Content-Type'] = 'text/html; charset=utf-8';
| Pluf_HTTP_Response::$status_code = 200 |
Status code of the answer.
| Pluf_HTTP_Response::$cookies = array() |
Cookies to send.
$this->cookies['my_cookie'] = 'content of the cookie';
| Pluf_HTTP_Response::$status_code_list |