Class jResponse

Description

base class for response object A response object is responsible to generate a content in a specific format.

  • abstract:

Located in /core/jResponse.class.php (line 19)


	
			
Direct descendents
Class Description
jResponseSoap Response for soap web services
jResponseHtmlFragment Send Html part
jResponseJson Json response
jResponseCmdline Command line response
jResponseRedirectUrl Response To redirect to an URL
jResponseTcpdf PDF Response based on TCPDF (http://tcpdf.sourceforge.net)
jResponseBinary Response use to send a binary file to the browser
jResponseXul Generate a XUL window
jResponseRedirect Response To redirect to an action
jResponseXml XML response generator
jResponseLatexToPdf pdf response, generated from a latex content
jResponseBasicHtml Basic HTML response. the HTML content should be provided by a simple php file.
jResponseXmlRpc xmlrpc response
jResponseRdf output RDF content.
jResponseCss Send CSS content
jResponseXMLFeed Responses for Syndication should inherits from jResponseXMLFeed
jResponseZip generate a zip content and send it to the browser
jResponseText plain Text response
jResponseSitemap Sitemap 0.9 response
jResponseJsonRpc Response for jsonrpc protocol
Variable Summary
Method Summary
jResponse __construct ()
void addHttpHeader (string $htype, string $hcontent, [boolean $overwrite = true])
string getFormatType ()
string getType ()
boolean output ()
void outputErrors ()
void sendHttpHeaders ()
void setHttpStatus (string $code, string $msg)
Variables
mixed $forcedHttpVersion = false (line 46)
  • access: public
mixed $httpVersion = '1.1' (line 45)
  • access: public
array $_httpHeaders = array() (line 29)
  • var: list of http headers that will be send to the client
  • access: protected
boolean $_httpHeadersSent = false (line 34)
  • var: indicates if http headers have already been sent to the client
  • access: protected
string $_httpStatusCode = '200' (line 39)
  • var: the http status code to send
  • access: protected
string $_httpStatusMsg = 'OK' (line 43)
  • var: the http status message to send
  • access: protected
Methods
Constructor __construct (line 51)

constructor

jResponse __construct ()

Redefined in descendants as:
addHttpHeader (line 107)

add an http header to the response.

will be send during the output of the response

  • access: public
void addHttpHeader (string $htype, string $hcontent, [boolean $overwrite = true])
  • string $htype: the header type ("Content-Type", "Date-modified"...)
  • string $hcontent: value of the header type
  • boolean $overwrite: false if the value should be set only if it doesn't still exist
clearHttpHeaders (line 116)

delete all http headers

  • access: public
void clearHttpHeaders ()
getFormatType (line 98)

return the format type name (eg the family type name)

  • return: the name
  • access: public
string getFormatType ()

Redefined in descendants as:
getType (line 92)

return the response type name

  • return: the name
  • access: public
string getType ()
output (line 68)

Send the response in the correct format. If errors or exceptions appears during this method, outputErrors will be called. So the the content should be generated using the output buffer if errors can be appeared during this generation. Be care of http headers.

  • return: true if the output is ok
  • abstract:
  • access: public
boolean output ()

Redefined in descendants as:
outputErrors (line 73)

Send a response with a generic error message.

  • access: public
void outputErrors ()

Redefined in descendants as:
sendHttpHeaders (line 132)

send http headers

  • access: protected
void sendHttpHeaders ()

Redefined in descendants as:
setHttpStatus (line 127)

set the http status code for the http header

  • access: public
void setHttpStatus (string $code, string $msg)
  • string $code: the status code (200, 404...)
  • string $msg: the message following the status code ("OK", "Not Found"..)

Documentation generated on Mon, 19 Sep 2011 14:13:20 +0200 by phpDocumentor 1.4.3