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
jResponseJson Json response
jResponseZip generate a zip content and send it to the browser
jResponseText plain Text response
jResponseCmdline Command line response
jResponseXMLFeed Responses for Syndication should inherits from jResponseXMLFeed
jResponseXul Generate a XUL window
jResponseRedirectUrl Response To redirect to an URL
jResponseCss Send CSS content
jResponseRedirect Response To redirect to an action
jResponseSoap Response for soap web services
jResponseXmlRpc xmlrpc response
jResponseHtmlFragment Send Html part
jResponseBinary Response use to send a binary file to the browser
jResponseTcpdf PDF Response based on TCPDF (http://tcpdf.sourceforge.net)
jResponseSitemap Sitemap 0.9 response
jResponseXml XML response generator
jResponseJsonRpc Response for jsonrpc protocol
jResponseLatexToPdf pdf response, generated from a latex content
jResponseHtml HTML response
jResponseRdf output RDF content.
Variable Summary
Method Summary
jResponse __construct ()
boolean acceptSeveralErrors ()
void addHttpHeader (string $htype, string $hcontent, [integer $overwrite = true])
string getFormatType ()
string getType ()
void hasErrors ()
boolean output ()
void outputErrors ()
void sendHttpHeaders ()
void setHttpStatus (string $code, string $msg)
Variables
boolean $_acceptSeveralErrors = true (line 29)
  • var: indicates if several errors can be returned by the response
  • access: protected

Redefined in descendants as:
array $_httpHeaders = array() (line 34)
  • var: list of http headers that will be send to the client
  • access: protected
boolean $_httpHeadersSent = false (line 39)
  • var: indicates if http headers have already been sent to the client
  • access: protected
string $_httpStatusCode = '200' (line 44)
  • var: the http status code to send
  • access: protected
string $_httpStatusMsg = 'OK' (line 48)
  • var: the http status message to send
  • access: protected
Methods
Constructor __construct (line 53)

constructor

jResponse __construct ()

Redefined in descendants as:
acceptSeveralErrors (line 87)

says if the response can embed more than one error message

  • return: true if many
  • access: public
boolean acceptSeveralErrors ()
addHttpHeader (line 103)

add an http header to the response.

will be send during the output of the response

  • access: public
void addHttpHeader (string $htype, string $hcontent, [integer $overwrite = true])
  • string $htype: the header type ("Content-Type", "Date-modified"...)
  • string $hcontent: value of the header type
  • integer $overwrite: false or 0 if the value should be set only if it doesn't still exist -1 to add the header with the existing values true or 1 to replace the existing header
clearHttpHeaders (line 123)

delete all http headers

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

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

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

Redefined in descendants as:
getType (line 75)

return the response type name

  • return: the name
  • access: public
string getType ()
hasErrors (line 92)
  • access: public
void hasErrors ()
output (line 62)

Send the response in the correct format.

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

Redefined in descendants as:
sendHttpHeaders (line 139)

send http headers

  • access: protected
void sendHttpHeaders ()

Redefined in descendants as:
setHttpStatus (line 134)

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 Thu, 19 Sep 2013 00:06:29 +0200 by phpDocumentor 1.4.3