jResponseHtml4

Extends \jResponseHtml

Response class for HTML 4 or XHTML 1.x

package

jelix

Methods

constructor

__construct() 
inherited

check if the request is of type GET or HEAD

_checkRequestType() 
inherited

Normalize a date into GMT format

_normalizeDate(mixed $date) : string
inherited

Arguments

$date

mixed

Can be a jDateTime object, a DateTime object or a string understandable by strtotime

Response

string

a date in GMT format

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

addContent(string $content, boolean $before = false) 
inherited

Arguments

$content

string

additionnal html content

$before

boolean

true if you want to add it before the content, else false for after

add a link to a css stylesheet stored into modules

addCSSLinkModule(string $module, mixed $src,  $params = array(), boolean $forIE = false) 
inherited
params

array $params additionnal parameters for the generated tag (a media attribute for stylesheet for example)

Arguments

$module

string

the module where file is stored

$src

mixed

the relative path inside the {module}/www/ directory

$params

$forIE

boolean

if true, the script sheet will be only for IE browser. string values possible (ex:'lt IE 7')

add a link to a csstheme stylesheet stored into modules

addCSSThemeLinkModule(string $module, mixed $src,  $params = array(), boolean $forIE = false) 
inherited
params

array $params additionnal parameters for the generated tag (a media attribute for stylesheet for example)

Arguments

$module

string

the module where file is stored

$src

mixed

the relative path inside the {module}/www/themes/{currenttheme}/ directory

$params

$forIE

boolean

if true, the script sheet will be only for IE browser. string values possible (ex:'lt IE 7')

add additional content into the document head

addHeadContent(string $content, boolean $toTop = false) 
inherited final
since 1.0b1

Arguments

$content

string

$toTop

boolean

true if you want to add it at the top of the head content, else false for the bottom

add an http header to the response.

addHttpHeader(string $htype, string $hcontent, integer $overwrite = true) 
inherited

will be send during the output of the response

Arguments

$htype

string

the header type ("Content-Type", "Date-modified"...)

$hcontent

string

value of the header type

$overwrite

integer

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

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

addJSCode(string $code, boolean $before = false) 
inherited

Arguments

$code

string

javascript source code

$before

boolean

will insert the code before js links if true

add a link to a javascript script stored into modules

addJSLinkModule(string $module, mixed $src, array $params = array(), boolean $forIE = false) 
inherited

Arguments

$module

string

the module where file is stored

$src

mixed

the relative path inside the {module}/www/ directory

$params

array

additionnal parameters for the generated tag (a media attribute for stylesheet for example)

$forIE

boolean

if true, the script sheet will be only for IE browser. string values possible (ex:'lt IE 7')

add a meta element

addMeta( $params) 
inherited

Arguments

$params

add author(s) in a author meta tag

addMetaAuthor(string $content) 
inherited
author

Olivier Demah

since 1.2

Arguments

$content

string

author(s)

add a description in a description meta tag

addMetaDescription(string $content) 
inherited
author

Yann

since 1.0b1

Arguments

$content

string

a description

add generator a generator meta tag

addMetaGenerator(string $content) 
inherited
author

Olivier Demah

since 1.2

Arguments

$content

string

generator

add some keywords in a keywords meta tag

addMetaKeywords(string $content) 
inherited
author

Yann

since 1.0b1

Arguments

$content

string

keywords

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

addStyle(string $selector, string $def = null) 
inherited

Arguments

$selector

string

css selector

$def

string

css properties for the given selector

Clean the differents caches headers

cleanCacheHeaders() 
inherited

used to erase some head properties

clearHtmlHeader(array $what = null) 
inherited

Arguments

$what

array

list of one or many of this strings : 'CSSLink', 'CSSIELink', 'Styles', 'JSLink', 'JSIELink', 'JSCode', 'Others','MetaKeywords','MetaDescription'. If null, it cleans all values.

delete all http headers

clearHttpHeaders() 
inherited

The method you can overload in your inherited html response overload it if you want to add processes (stylesheet, head settings, additionnal content etc.

doAfterActions() 
inherited

.) after any actions

since 1.1

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

endTag() : string
inherited

Response

string

return the format type name (eg the family type name)

getFormatType() : string
inherited

Response

string

the name

return the corresponding plugin

getPlugin(string $name) : \jIHTMLResponsePlugin|null
inherited
since 1.3a1

Arguments

$name

string

the name of the plugin

Response

\jIHTMLResponsePlugin|null

the plugin or null if it isn't loaded

return the response type name

getType() : string
inherited final

Response

string

the name

Use the HTPP headers Last-Modified to see if the ressource in client cache is fresh

isValidCache(mixed $dateLastModified = null,  $etag = null, boolean $cleanCacheHeader = true) : boolean
inherited

Arguments

$dateLastModified

mixed

Can be a jDateTime object, a DateTime object or a string understandable by strtotime

$etag

$cleanCacheHeader

boolean

True for clean/delete other cache headers. Default : true.

Response

boolean

True if the client ressource version is fresh, false otherwise

says if the response will be xhtml or html

isXhtml() : boolean
inherited final

Response

boolean

true if it is xhtml

output the html content

output() : boolean
inherited
Throws
\Exception

Response

boolean

true if the generated content is ok

outputCssLinkTag

outputCssLinkTag( $fileUrl,  $cssParams) 
inherited

Arguments

$fileUrl

$cssParams

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

outputDoctype() 
inherited
since 1.1

Send a response with a generic error message.

outputErrors() 
inherited

generate the content of the <head> content

outputHtmlHeader() 
inherited

outputJsScriptTag

outputJsScriptTag( $fileUrl,  $scriptParams) 
inherited

Arguments

$fileUrl

$scriptParams

outputMetaTag

outputMetaTag(array<mixed,string> $params) 
inherited
since 1.6.17

Arguments

$params

array<mixed,string>

list of attributes to add to a meta element

send http headers

sendHttpHeaders() 
inherited

set attributes on the body tag

setBodyAttributes(array $attrArray) 
inherited

Arguments

$attrArray

array

an associative array of attributes and their values

set the content-type in the http headers

setContentType() 
inherited

Set an expires header to the page/ressource.

setExpires( $date,  $cleanCacheHeader = true) 
inherited
see \_normalizeDate

Arguments

$date

$cleanCacheHeader

set the http status code for the http header

setHttpStatus(string $code, string $msg) 
inherited

Arguments

$code

string

the status code (200, 404...)

$msg

string

the message following the status code ("OK", "Not Found"..)

Set a life time for the page/ressource.

setLifetime(integer $time, boolean $sharedCache = false,  $cleanCacheHeader = true) 
inherited

Arguments

$time

integer

Time during which the page will be cached. Express in seconds.

$sharedCache

boolean

True if the lifetime concern a public/shared cache. Default : false.

$cleanCacheHeader

set the title of the page

setTitle(string $title) 
inherited

Arguments

$title

string

change the type of html for the output

setXhtmlOutput(boolean $xhtml = true) 
inherited

Arguments

$xhtml

boolean

true if you want xhtml, false if you want html

activate / deactivate the strict Doctype (activated by default)

strictDoctype(boolean $val = true) 
since 1.1.3

Arguments

$val

boolean

true for strict, false for transitional

Properties

says if the document is in xhtml or html

_isXhtml : 
inherited

Type(s)

says if the document uses a Strict or Transitional Doctype

_strictDoctype : boolean
var

Type(s)

boolean

ident of the response type

_type : string
inherited
var

ident of the response type

Type(s)

string

Title of the document

title : string
inherited
var

Type(s)

string

favicon url linked to the document

favicon : string
inherited
var
since

Type(s)

string

The template engine used to generate the body content

body : \jTpl
inherited
var

Type(s)

\jTpl

selector of the main template file This template should contains the body content, and is used by the $body template engine

bodyTpl : string
inherited
var

Type(s)

string

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

bodyErrorTpl : string
inherited
var

Type(s)

string

body attributes This attributes are written on the body tags

bodyTagAttributes : array
inherited
var

Type(s)

array

indicate the value for the X-UA-Compatible meta element, which indicate the compatiblity mode of IE. Exemple: "IE=edge" In future version, default will be "IE=edge".

IECompatibilityMode : string
inherited
var

indicate the value for the X-UA-Compatible meta element, which indicate the compatiblity mode of IE. Exemple: "IE=edge" In future version, default will be "IE=edge".

since

Type(s)

string

the content of the viewport meta element

metaViewport : string
inherited
var

the content of the viewport meta element

since

Type(s)

string

list of CSS code

_Styles : 
inherited

Type(s)

inline js code to insert before js links

_JSCodeBefore : array
inherited
var

list of js source code

Type(s)

array

inline js code to insert after js links

_JSCode : array
inherited
var

list of js source code

Type(s)

array

list of keywords to add into a meta keyword tag

_MetaKeywords : array
inherited
var

array of strings

Type(s)

array

list of descriptions to add into a meta description tag

_MetaDescription : array
inherited
var

array of strings

Type(s)

array

content of the meta author tag

_MetaAuthor : string
inherited
var

Type(s)

string

content of the meta generator tag

_MetaGenerator : string
inherited
var

Type(s)

string

false if it should be output <meta charset=""/> or true for the default old behavior : <meta content="text/html; charset=""../>

_MetaOldContentType : boolean
inherited
var

false if it should be output or true for the default old behavior : <meta content="text/html; charset=""../>

since

Type(s)

boolean

list of arrays containing attributes for each meta elements

_Meta : array<mixed,array>
inherited
var

list of arrays containing attributes for each meta elements

since

Type(s)

array<mixed,array>

the end tag to finish tags. it is different if we are in XHTML mode or not

_endTag : string
inherited
var

Type(s)

string

the charset of the document

_charset : string
inherited
var

Type(s)

string

the lang of the document

_lang : string
inherited
var

Type(s)

string

says if xhtml content type should be send or not.

xhtmlContentType : boolean
inherited

it true, a verification of HTTP_ACCEPT is done.

var

Type(s)

boolean

top content for head

_headTop : 
inherited

Type(s)

bottom content for head

_headBottom : 
inherited

Type(s)

_bodyTop

_bodyTop : 
inherited

Type(s)

_bodyBottom

_bodyBottom : 
inherited

Type(s)

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.

htmlFile : string
inherited

.

var

Type(s)

string

list of plugins

plugins : array<mixed,\jIHTMLResponsePlugin>
inherited
var
since

Type(s)

array<mixed,\jIHTMLResponsePlugin>

list of http headers that will be send to the client

_httpHeaders : array
inherited
var

list of http headers that will be send to the client

Type(s)

array

indicates if http headers have already been sent to the client

_httpHeadersSent : boolean
inherited
var

indicates if http headers have already been sent to the client

Type(s)

boolean

the http status code to send

_httpStatusCode : string
inherited
var

the http status code to send

Type(s)

string

the http status message to send

_httpStatusMsg : string
inherited
var

the http status message to send

Type(s)

string

Should we output only the headers or the entire response

_outputOnlyHeaders : boolean
inherited
var

Should we output only the headers or the entire response

Type(s)

boolean

httpVersion

httpVersion : 
inherited

Type(s)

forcedHttpVersion

forcedHttpVersion : 
inherited

Type(s)