Class jResponseHtml

Description

HTML response

Located in /core/response/jResponseHtml.class.php (line 28)

jResponse
   |
   --jResponseHtml
Variable Summary
string $bodyErrorTpl
string $bodyTpl
string $favicon
string $title
array $_bodyBottom
array $_bodyTop
string $_charset
array $_CSSIELink
array $_CSSLink
mixed $_endTag
integer $_headSent
mixed $_isXhtml
array $_JSCode
array $_JSIELink
array $_JSLink
string $_lang
array $_Link
array $_MetaAuthor
array $_Others
boolean $_strictDoctype
array $_Styles
string $_type
Method Summary
jResponseHtml __construct ()
void addContent (string $content, [boolean $beforeTpl = false])
void addCSSLink (string $src, [array $params = array ()], [mixed $forIE = false])
void addHeadContent (string $content)
void addJSCode (string $code, [boolean $before = false])
void addJSLink (string $src, [array $params = array()], [boolean $forIE = false])
void addLink (string $href, string $rel, [string $type = ''], [string $title = ''])
void addMetaAuthor (string $content)
void addMetaDescription (string $content)
void addMetaGenerator (string $content)
void addMetaKeywords (string $content)
void addStyle (string $selector, [string $def = null])
void clearHtmlHeader ([array $what = null])
void doAfterActions ()
string endTag ()
boolean isXhtml ()
boolean output ()
void outputCssLinks ( &$linkList)
void outputCssLinkTag ( $fileUrl,  $cssParams, [ $filePath = null])
void outputDoctype ()
void outputErrors ()
void outputJsScripts ( &$scriptList)
void outputJsScriptTag ( $fileUrl,  $scriptParams, [ $filePath = null])
void setXhtmlOutput ([boolean $xhtml = true])
void strictDoctype ([boolean $val = true])
Variables
jTpl $body = null (line 52)

The template engine used to generate the body content

  • access: public
string $bodyErrorTpl = '' (line 65)

Selector of the template used when there are some errors, instead of $bodyTpl

  • access: public
array $bodyTagAttributes = array() (line 72)

body attributes

This attributes are written on the body tags

  • access: public
string $bodyTpl = '' (line 59)

selector of the main template file

This template should contains the body content, and is used by the $body template engine

  • access: public
string $favicon = '' (line 46)

favicon url linked to the document

  • since: 1.0b2
  • access: public
string $title = '' (line 39)

Title of the document

  • access: public
boolean $xhtmlContentType = false (line 141)

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

content for the body

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

content for the body

  • access: protected
string $_charset (line 84)

the charset of the document

  • access: protected
array $_CSSIELink = array () (line 101)

content for the head

  • access: protected
array $_CSSLink = array () (line 100)

content for the head

  • access: protected
mixed $_endTag = "/>\n" (line 127)
  • access: protected
integer $_headSent = 0 (line 78)

says what part of the html head has been send

  • access: protected
mixed $_isXhtml = true (line 126)

says if the document is in xhtml or html

  • access: protected
array $_JSCode = array () (line 106)

content for the head

  • access: protected
array $_JSCodeBefore = array () (line 105)

content for the head

  • access: protected
array $_JSIELink = array () (line 104)

content for the head

  • access: protected
array $_JSLink = array () (line 103)

content for the head

  • access: protected
string $_lang (line 90)

the lang of the document

  • access: protected
array $_Link = array() (line 112)

content for the head

  • access: protected
array $_MetaAuthor = '' (line 110)

content for the head

  • access: protected
array $_MetaDescription = array() (line 109)

content for the head

  • access: protected
array $_MetaGenerator = '' (line 111)

content for the head

  • access: protected
array $_MetaKeywords = array() (line 108)

content for the head

  • access: protected
array $_Others = array () (line 107)

content for the head

  • access: protected
boolean $_strictDoctype = true (line 134)

says if the document uses a Strict or Transitional Doctype

  • since: 1.1.3
  • access: protected
array $_Styles = array () (line 102)

content for the head

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

jresponse id

  • access: protected

Redefinition of:
jResponse::$_type

Inherited Variables

Inherited from jResponse

jResponse::$_acceptSeveralErrors
jResponse::$_httpHeaders
jResponse::$_httpHeadersSent
jResponse::$_httpStatusCode
jResponse::$_httpStatusMsg
Methods
Constructor __construct (line 148)

constructor;

setup the charset, the lang, the template engine

jResponseHtml __construct ()

Redefinition of:
jResponse::__construct()
constructor
addContent (line 292)

add content to the body

you can add additionnal content, before or after the content generated by the main template

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

add a link to a css stylesheet in the document head

$forIe parameter exists since 1.0b2

  • access: public
void addCSSLink (string $src, [array $params = array ()], [mixed $forIE = false])
  • string $src: the link
  • array $params: additionnals attributes for the link tag
  • mixed $forIE: if true, the style sheet will be only for IE browser. string values possible (ex:'lt IE 7')
addHeadContent (line 372)

add additional content into the document head

  • since: 1.0b1
  • access: public
void addHeadContent (string $content)
  • string $content
addJSCode (line 381)

add inline javascript code (inside a <script> tag)

  • access: public
void addJSCode (string $code, [boolean $before = false])
  • string $code: javascript source code
  • boolean $before: will insert the code before js links if true
addJSLink (line 321)

add a link to a javascript script in the document head

$forIe parameter exists since 1.0b2

  • access: public
void addJSLink (string $src, [array $params = array()], [boolean $forIE = false])
  • string $src: the link
  • array $params: additionnals attributes for the script tag
  • boolean $forIE: if true, the script sheet will be only for IE browser
addLink (line 308)

add a generic link to the head

  • access: public
void addLink (string $href, string $rel, [string $type = ''], [string $title = ''])
  • string $href: url of the link
  • string $rel: relation name
  • string $type: mime type of the ressource
  • string $title
addMetaAuthor (line 412)

add author(s) in a author meta tag

  • author: Olivier Demah
  • since: 1.2
  • access: public
void addMetaAuthor (string $content)
  • string $content: author(s)
addMetaDescription (line 403)

add a description in a description meta tag

  • author: Yann
  • since: 1.0b1
  • access: public
void addMetaDescription (string $content)
  • string $content: a description
addMetaGenerator (line 421)

add generator a generator meta tag

  • author: Olivier Demah
  • since: 1.2
  • access: public
void addMetaGenerator (string $content)
  • string $content: generator
addMetaKeywords (line 394)

add some keywords in a keywords meta tag

  • author: Yann
  • since: 1.0b1
  • access: public
void addMetaKeywords (string $content)
  • string $content: keywords
addStyle (line 361)

add inline css style into the document (inside a <style> tag)

  • access: public
void addStyle (string $selector, [string $def = null])
  • string $selector: css selector
  • string $def: css properties for the given selector
clearHtmlHeader (line 724)

used to erase some head properties

  • access: public
void clearHtmlHeader ([array $what = null])
  • array $what: list of one or many of this strings : 'CSSLink', 'CSSIELink', 'Styles', 'JSLink', 'JSIELink', 'JSCode', 'Others','MetaKeywords','MetaDescription'. If null, it cleans all values.
doAfterActions (line 244)

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 all actions

  • since: 1.1
  • access: protected
void doAfterActions ()
endTag (line 767)

return the end of a html tag : "/>" or ">", depending if it will generate xhtml or html

  • access: public
string endTag ()
getFormatedErrorMsg (line 275)

create html error messages

  • return: html content
  • access: protected
string getFormatedErrorMsg ()
isXhtml (line 761)

says if the response will be xhtml or html

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

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.
outputCssLinks (line 540)
  • access: protected
void outputCssLinks ( &$linkList)
  • &$linkList
outputCssLinkTag (line 461)
  • access: protected
void outputCssLinkTag ( $fileUrl,  $cssParams, [ $filePath = null])
  • $fileUrl
  • $cssParams
  • $filePath
outputDoctype (line 428)

generate the doctype. You can override it if you want to have your own doctype, like XHTML+MATHML.

  • since: 1.1
  • access: protected
void outputDoctype ()
outputErrors (line 251)

output errors

  • access: public
void outputErrors ()

Redefinition of:
jResponse::outputErrors()
Send a response with only error messages which appears during the action
outputHtmlHeader (line 614)

generate the content of the <head> content

  • access: protected
void outputHtmlHeader ()
outputJsScripts (line 483)
  • access: protected
void outputJsScripts ( &$scriptList)
  • &$scriptList
outputJsScriptTag (line 439)
  • access: protected
void outputJsScriptTag ( $fileUrl,  $scriptParams, [ $filePath = null])
  • $fileUrl
  • $scriptParams
  • $filePath
setXhtmlOutput (line 740)

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
strictDoctype (line 753)

activate / deactivate the strict Doctype (activated by default)

  • since: 1.1.3
  • access: public
void strictDoctype ([boolean $val = true])
  • boolean $val: true for strict, false for transitional

Inherited Methods

Inherited From jResponse

jResponse::__construct()
jResponse::acceptSeveralErrors()
jResponse::addHttpHeader()
jResponse::clearHttpHeaders()
jResponse::getFormatType()
jResponse::getType()
jResponse::hasErrors()
jResponse::output()
jResponse::outputErrors()
jResponse::sendHttpHeaders()
jResponse::setHttpStatus()

Documentation generated on Thu, 19 Sep 2013 00:06:41 +0200 by phpDocumentor 1.4.3