Class jResponseHtml

Description

HTML response

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

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 $_Others
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 addMetaDescription (string $content)
void addMetaKeywords (string $content)
void addStyle (string $selector, [string $def = null])
void clearHtmlHeader ([array $what = null])
string endTag ()
boolean isXhtml ()
boolean output ()
void outputErrors ()
void setXhtmlOutput ([boolean $xhtml = true])
void _commonProcess ()
Variables
jTpl $body = null (line 49)

The template engine used to generate the body content

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

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

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

body attributes

This attributes are written on the body tags

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

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

favicon url linked to the document

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

Title of the document

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

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

content for the body

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

content for the body

  • access: protected
string $_charset (line 81)

the charset of the document

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

content for the head

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

content for the head

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

says what part of the html head has been send

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

says if the document is in xhtml or html

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

content for the head

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

content for the head

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

content for the head

  • access: protected
string $_lang (line 87)

the lang of the document

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

content for the head

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

content for the head

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

content for the head

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

content for the head

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

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

constructor;

setup the charset, the lang, the template engine

jResponseHtml __construct ()

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

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

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

add additional content into the document head

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

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

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

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

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

add some keywords in a keywords meta tag

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

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

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.
endTag (line 525)

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

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

create html error messages

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

says if the response will be xhtml or html

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

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.
outputErrors (line 239)

output errors

  • access: public
void outputErrors ()

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

generate the content of the <head> content

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

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

The method you can overload in your inherited html response

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

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