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
jResponseHtml HTML response
jResponseJson Json 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
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
jResponseJsonRpc Response for jsonrpc protocol
Variable Summary
Method Summary
jResponse __construct ()
boolean acceptSeveralErrors ()
void addHttpHeader (string $htype, string $hcontent, [boolean $overwrite = true])
string getFormatType ()
string getType ()
void hasErrors ()
boolean output ()
void outputErrors ()
void sendHttpHeaders ()
void setHttpStatus (string $code, string $msg)
Variables
mixed $_errorMessages = array() (line 26)
  • access: protected
mixed $_httpHeaders = array() (line 30)
  • access: protected
mixed $_httpHeadersSent = false (line 32)
  • access: protected
mixed $_httpStatusCode = '200' (line 34)
  • access: protected
mixed $_httpStatusMsg = 'OK' (line 36)
  • access: protected
Methods
Constructor __construct (line 41)

constructor

jResponse __construct ()

Redefined in descendants as:
acceptSeveralErrors (line 75)

says if the response can embed more than one error message

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

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 98)

delete all http headers

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

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

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

Redefined in descendants as:
getType (line 63)

return the response type name

  • return: the name
  • access: public
string getType ()
hasErrors (line 80)
  • access: public
void hasErrors ()
output (line 50)

Send the response in the correct format.

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

Redefined in descendants as:
outputErrors (line 57)

Send a response with only error messages which appears during the action

(errors, warning, notice, exceptions...). Type and error details depend on the application configuration

  • abstract:
  • access: public
void outputErrors ()

Redefined in descendants as:
sendHttpHeaders (line 114)

send http headers

  • access: protected
void sendHttpHeaders ()
setHttpStatus (line 109)

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 Wed, 07 Sep 2011 13:47:41 +0200 by phpDocumentor 1.4.3