Template
in package
Table of Contents
Properties
- $listjsInclude : string|null
- Defines a listjs_include.js function to call at the end of the HTML body.
- $jsAlerts : array<string|int, string>
- $jsSources : array<string|int, string>
- $ajaxJS : array<string, mixed>
- $data : array<string, mixed>
- $nestedIncludes : int
Methods
- addJavascriptForAjax() : string
- assign() : void
- display() : void
- Displays the template HTML. Stores any ajax-enabled elements for future comparison, and outputs modified elements in XML for ajax if requested.
- getInstance() : self
- Return the Smr\Template in the DI container.
- hasTemplateVar() : bool
- unassign() : void
- addJavascriptAlert() : void
- addJavascriptSource() : void
- Registers a JS target for inclusion at the end of the HTML body.
- checkDisableAJAX() : bool
- Check if the HTML includes input elements where the user is able to input data (i.e. we don't want to AJAX update a form that they may have already started filling out).
- convertHtmlToAjaxXml() : string
- doAn() : string
- doDamageTypeReductionDisplay() : void
- getTemplateLocation() : string
- includeTemplate() : void
Properties
$listjsInclude
Defines a listjs_include.js function to call at the end of the HTML body.
public
string|null
$listjsInclude
= null
$jsAlerts
protected
array<string|int, string>
$jsAlerts
= []
$jsSources
protected
array<string|int, string>
$jsSources
= []
$ajaxJS
private
array<string, mixed>
$ajaxJS
= []
$data
private
array<string, mixed>
$data
= []
$nestedIncludes
private
int
$nestedIncludes
= 0
Methods
addJavascriptForAjax()
public
addJavascriptForAjax(string $varName, mixed $obj) : string
Parameters
- $varName : string
- $obj : mixed
Return values
stringassign()
public
assign(string $var, mixed $value) : void
Parameters
- $var : string
- $value : mixed
display()
Displays the template HTML. Stores any ajax-enabled elements for future comparison, and outputs modified elements in XML for ajax if requested.
public
display(string $templateName[, bool $outputXml = false ]) : void
Parameters
- $templateName : string
- $outputXml : bool = false
getInstance()
Return the Smr\Template in the DI container.
public
static getInstance() : self
If one does not exist yet, it will be created. This is the intended way to construct this class.
Return values
selfhasTemplateVar()
public
hasTemplateVar(string $var) : bool
Parameters
- $var : string
Return values
boolunassign()
public
unassign(string $var) : void
Parameters
- $var : string
addJavascriptAlert()
protected
addJavascriptAlert(string $string) : void
Parameters
- $string : string
addJavascriptSource()
Registers a JS target for inclusion at the end of the HTML body.
protected
addJavascriptSource(string $src) : void
Parameters
- $src : string
checkDisableAJAX()
Check if the HTML includes input elements where the user is able to input data (i.e. we don't want to AJAX update a form that they may have already started filling out).
protected
checkDisableAJAX(string $html) : bool
Parameters
- $html : string
Return values
boolconvertHtmlToAjaxXml()
protected
convertHtmlToAjaxXml(string $str, bool $returnXml) : string
Parameters
- $str : string
- $returnXml : bool
Return values
stringdoAn()
protected
doAn(string $wordAfter) : string
Parameters
- $wordAfter : string
Return values
stringdoDamageTypeReductionDisplay()
protected
doDamageTypeReductionDisplay(int &$damageTypes) : void
Parameters
- $damageTypes : int
getTemplateLocation()
protected
getTemplateLocation(string $templateName) : string
Parameters
- $templateName : string
Return values
stringincludeTemplate()
protected
includeTemplate(string $templateName[, array<string, mixed>|null $assignVars = null ]) : void
Parameters
- $templateName : string
- $assignVars : array<string, mixed>|null = null