\patTemplate_Dump_Html

Dumps templates as HTML

The dump functionality is separated from the main class for performance reasons.

Summary

Methods
Properties
Constants
setTemplateReference()
displayHeader()
dumpGlobals()
dumpTemplates()
displayFooter()
_flattenVars()
_extractVars()
getName()
setParams()
getParam()
_displayVariables()
_displayConditions()
_displayAttributes()
_displayTemplateState()
_highlightVars()
_displayHead()
_getClassName()
_useBorders()
_displayLine()
$_tmpl
$_name
$_params
$colors
$_useBorders
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_tmpl

$_tmpl : object

reference to the patTemplate object that instantiated the module

Type

object

$_name

$_name : string

module name

This has to be set in the final module classes.

Type

string

$_params

$_params : array

module parameters

Type

array

$colors

$colors : 

Type

$_useBorders

$_useBorders : 

Type

Methods

setTemplateReference()

setTemplateReference(  $tmpl) 

set a reference to the patTemplate object that instantiated the reader

Parameters

$tmpl

displayHeader()

displayHeader() 

display the header

dumpGlobals()

dumpGlobals(  $globals) 

dump the global variables

Parameters

$globals

dumpTemplates()

dumpTemplates(  $templates,   $vars) 

dump the templates

This method has to be implemented in the dumpers.

Parameters

$templates
$vars

displayFooter()

displayFooter() 

display the footer

_flattenVars()

_flattenVars(  $vars) : array

flatten the variables

This will convert the variable definitions to a one-dimensional array. If there are rows defined, they will be converted to a string where the values are seperated with commas.

Parameters

$vars

Returns

array —

flattened variables

_extractVars()

_extractVars(  $template) : array

extract all variables from a template

Parameters

$template

Returns

array —

array containing all variables

getName()

getName() : string

get the name of the module

Returns

string —

name of the module

setParams()

setParams(  $params,   $clear = false) 

sets parameters of the module

Parameters

$params
$clear

getParam()

getParam(  $name) : mixed

gets a parameter of the module

Parameters

$name

Returns

mixed —

value of the parameter

_displayVariables()

_displayVariables(  $tmpl,   $tmplName,   $setVars,   $vars) 

Parameters

$tmpl
$tmplName
$setVars
$vars

_displayConditions()

_displayConditions(  $tmpl,   $tmplName,   $vars) 

Parameters

$tmpl
$tmplName
$vars

_displayAttributes()

_displayAttributes(  $tmpl,   $tmplName = null) 

display the attributes of a template

Parameters

$tmpl
$tmplName

_displayTemplateState()

_displayTemplateState(  $tmpl) 

Parameters

$tmpl

_highlightVars()

_highlightVars(  $template,   $vars) : string

hilight variables in a template

Parameters

$template
$vars

Returns

string —

template content

_displayHead()

_displayHead() 

display a table header

_getClassName()

_getClassName(  $class) 

Parameters

$class

_useBorders()

_useBorders(boolean  $state) 

sets whether to draw borders in the tables generated via the {@link _displayHead()} and {@link _displayLine()} methods.

Parameters

boolean $state

Whether to draw the borders. true=draw, false=don't draw

_displayLine()

_displayLine(  $prop,   $value) 

display a line in a table

Parameters

$prop
$value