Class jResponseBasicHtml

Description

Basic HTML response. the HTML content should be provided by a simple php file.

Located in /core/response/jResponseBasicHtml.class.php (line 52)

jResponse
   |
   --jResponseBasicHtml
Direct descendents
Class Description
jResponseHtml HTML5 response
Variable Summary
string $htmlFile
array $plugins
array $_bodyBottom
array $_bodyTop
string $_charset
mixed $_headBottom
mixed $_headTop
mixed $_isXhtml
string $_lang
string $_type
Method Summary
jResponseBasicHtml __construct ()
void addContent (string $content, [boolean $before = false])
void addHeadContent (string $content, [boolean $toTop = false])
void doAfterActions ()
jIHTMLResponsePlugin|null getPlugin (string $name)
boolean isXhtml ()
boolean output ()
void outputErrors ()
void setContentType ()
void setXhtmlOutput ([boolean $xhtml = true])
Variables
string $htmlFile = '' (line 111)

full path of php file to output. it should content php instruction

to display these variables:

  • $HEADTOP: content added just after the opening <head> tag
  • $HEADBOTTOM: content before the closing </head> tag
  • $BODYTOP: content just after the <body> tag, at the top of the page
  • $BODYBOTTOM: content just before the </body> tag, at the bottom of the page
  • $BASEPATH: base path of the application, for links of your style sheets etc..

  • access: public
array $plugins = array() (line 118)

list of plugins

  • var: array of jIHTMLResponsePlugin
  • since: 1.3a1
  • access: protected
boolean $xhtmlContentType = false (line 81)

says if xhtml content type should be send or not.

it true, a verification of HTTP_ACCEPT is done.

  • access: public
array $_bodyBottom = array() (line 98)

content for the body

  • access: protected
array $_bodyTop = array() (line 97)

content for the body

  • access: protected
string $_charset (line 63)

the charset of the document

  • access: protected
mixed $_headBottom = array () (line 91)

bottom content for head

  • access: protected
mixed $_headTop = array () (line 86)

top content for head

  • access: protected
mixed $_isXhtml = false (line 74)

says if the document is in xhtml or html

  • access: protected

Redefined in descendants as:
string $_lang (line 69)

the lang of the document

  • access: protected
string $_type = 'html' (line 57)

jresponse id

  • access: protected

Redefinition of:
jResponse::$_type

Redefined in descendants as:

Inherited Variables

Inherited from jResponse

jResponse::$forcedHttpVersion
jResponse::$httpVersion
jResponse::$_httpHeaders
jResponse::$_httpHeadersSent
jResponse::$_httpStatusCode
jResponse::$_httpStatusMsg
jResponse::$_outputOnlyHeaders
Methods
Constructor __construct (line 124)

constructor;

setup the charset, the lang

jResponseBasicHtml __construct ()

Redefinition of:
jResponse::__construct()
constructor

Redefined in descendants as:
addContent (line 179)

add content to the body

you can add additionnal content, before or after the content of body

void addContent (string $content, [boolean $before = false])
  • string $content: additionnal html content
  • boolean $before: true if you want to add it before the content, else false for after
addHeadContent (line 164)

add additional content into the document head

  • since: 1.0b1
  • access: public
void addHeadContent (string $content, [boolean $toTop = false])
  • string $content
  • boolean $toTop: true if you want to add it at the top of the head content, else false for the bottom
doAfterActions (line 249)

The method you can overload in your inherited html response

overload it if you want to add processes (stylesheet, head settings, additionnal content etc..) after any actions

  • since: 1.1
  • access: protected
void doAfterActions ()
getPlugin (line 152)

return the corresponding plugin

  • return: the plugin or null if it isn't loaded
  • since: 1.3a1
jIHTMLResponsePlugin|null getPlugin (string $name)
  • string $name: the name of the plugin
isXhtml (line 296)

says if the response will be xhtml or html

  • return: true if it is xhtml
  • access: public
boolean isXhtml ()
output (line 204)

output the html content

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

Redefinition of:
jResponse::output()
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.

Redefined in descendants as:
outputErrors (line 256)

output errors

  • access: public
void outputErrors ()

Redefinition of:
jResponse::outputErrors()
Send a response with a generic error message.
setContentType (line 191)

set the content-type in the http headers

  • access: protected
void setContentType ()
setXhtmlOutput (line 288)

change the type of html for the output

  • access: public
void setXhtmlOutput ([boolean $xhtml = true])
  • boolean $xhtml: true if you want xhtml, false if you want html

Redefined in descendants as:

Inherited Methods

Inherited From jResponse

jResponse::__construct()
jResponse::addHttpHeader()
jResponse::cleanCacheHeaders()
jResponse::clearHttpHeaders()
jResponse::getFormatType()
jResponse::getType()
jResponse::isValidCache()
jResponse::output()
jResponse::outputErrors()
jResponse::sendHttpHeaders()
jResponse::setExpires()
jResponse::setHttpStatus()
jResponse::setLifetime()
jResponse::_checkRequestType()
jResponse::_normalizeDate()

Documentation generated on Wed, 04 Jan 2017 22:56:10 +0100 by phpDocumentor 1.4.3