Documentation

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
string

assign()

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
self

hasTemplateVar()

public hasTemplateVar(string $var) : bool
Parameters
$var : string
Return values
bool

unassign()

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
bool

convertHtmlToAjaxXml()

protected convertHtmlToAjaxXml(string $str, bool $returnXml) : string
Parameters
$str : string
$returnXml : bool
Return values
string

doAn()

protected doAn(string $wordAfter) : string
Parameters
$wordAfter : string
Return values
string

doDamageTypeReductionDisplay()

protected doDamageTypeReductionDisplay(int &$damageTypes) : void
Parameters
$damageTypes : int

getTemplateLocation()

protected getTemplateLocation(string $templateName) : string
Parameters
$templateName : string
Return values
string

includeTemplate()

protected includeTemplate(string $templateName[, array<string, mixed> $assignVars = null ]) : void
Parameters
$templateName : string
$assignVars : array<string, mixed> = null

        
On this page

Search results