Class jResponseHtml

Description

HTML response

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

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 $_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)
void addJSLink (string $src, [array $params = array()], [boolean $forIE = false])
void addLink (string $href, string $rel, [string $type = ''], [string $title = ''])
void addMetaDescription (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 outputDoctype ()
void outputErrors ()
void setXhtmlOutput ([boolean $xhtml = true])
void strictDoctype ([boolean $val = true])
void _commonProcess ()
Variables
jTpl $body = null (line 51)

The template engine used to generate the body content

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

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

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

body attributes

This attributes are written on the body tags

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

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

favicon url linked to the document

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

Title of the document

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

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

content for the body

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

content for the body

  • access: protected
string $_charset (line 83)

the charset of the document

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

content for the head

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

content for the head

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

says what part of the html head has been send

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

says if the document is in xhtml or html

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

content for the head

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

content for the head

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

content for the head

  • access: protected
string $_lang (line 89)

the lang of the document

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

content for the head

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

content for the head

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

content for the head

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

content for the head

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

says if the document uses a Strict or Transitional Doctype

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

content for the head

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

jresponse id

  • access: protected

Redefinition of:
jResponse::$_type
ident of the response type

Inherited Variables

Inherited from jResponse

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

constructor;

setup the charset, the lang, the template engine

jResponseHtml __construct ()

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

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

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

add additional content into the document head

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

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

  • access: public
void addJSCode (string $code)
  • string $code: javascript source code
addJSLink (line 319)

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

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
addMetaDescription (line 397)

add a description in a description meta tag

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

add some keywords in a keywords meta tag

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

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

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

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

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

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

create html error messages

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

says if the response will be xhtml or html

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

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.
outputDoctype (line 405)

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

output errors

  • access: public
void outputErrors ()

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

generate the content of the <head> content

  • access: protected
void outputHtmlHeader ()
setXhtmlOutput (line 555)

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

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
_commonProcess (line 246)

same use as doAfterActions, but deprecated method. It is just here for compatibility with Jelix 1.0.

Use doAfterActions instead

  • deprecated:
  • access: protected
void _commonProcess ()

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, 22 Mar 2012 22:16:41 +0100 by phpDocumentor 1.4.3