\patTemplate_Dump

Base class for patTemplate dumpers

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

Summary

Methods
Properties
Constants
getName()
setParams()
getParam()
setTemplateReference()
displayHeader()
dumpGlobals()
dumpTemplates()
displayFooter()
_flattenVars()
_extractVars()
$_name
$_params
$_tmpl
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_name

$_name : string

module name

This has to be set in the final module classes.

Type

string

$_params

$_params : array

module parameters

Type

array

$_tmpl

$_tmpl : object

reference to the patTemplate object that instantiated the module

Type

object

Methods

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

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