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
jResponseBasicHtml Basic HTML response. the HTML content should be provided by a simple php file.
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
jResponseRdf output RDF content.
Variable Summary
Method Summary
jResponse __construct ()
void addHttpHeader (string $htype, string $hcontent, [integer $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 109)

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

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

send http headers

  • access: protected
void sendHttpHeaders ()

Redefined in descendants as:
setHttpStatus (line 140)

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, 24 Sep 2014 22:01:14 +0200 by phpDocumentor 1.4.3