Pluf_HTTP_Response Class Reference

Inheritance diagram for Pluf_HTTP_Response:

Pluf_HTTP_Response_CommandPassThru Pluf_HTTP_Response_File Pluf_HTTP_Response_Forbidden Pluf_HTTP_Response_Json Pluf_HTTP_Response_NotAvailable Pluf_HTTP_Response_NotFound Pluf_HTTP_Response_Redirect Pluf_HTTP_Response_RedirectToLogin Pluf_HTTP_Response_ServerError Pluf_HTTP_Response_ServerErrorDebug

List of all members.

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


Detailed Description

Response object to be constructed by the views.

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.


Constructor & Destructor Documentation

Pluf_HTTP_Response::__construct ( content = '',
mimetype = null 
)

Constructor of the response.

Parameters:
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.


Member Function Documentation

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.


Member Data Documentation

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


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen