\Template

Manages html outputs.

Summary

Methods
Properties
Constants
__construct()
displayHtml()
getHtml()
addReplacement()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
substitute()
$currTemplate
$replacements
$serverUrl
N/A

Properties

$currTemplate

$currTemplate : string

Holds the template which is currently in use.

Type

normal

$replacements

$replacements : array

Holds key => value pairs for substitution (i.e., every occurrence of key should be replaced by value).

Type

normal

$serverUrl

$serverUrl : string

Holds the server url which is defined in the docker-compose.yml file.

Type

normal

Methods

__construct()

__construct(string  $name) : mixed

Receives the name of a html template and displays it.

Parameters

string $name

The name of the html template to display.

Returns

mixed

displayHtml()

displayHtml() : void

Displays the currently selected html template.

getHtml()

getHtml() : string

Returns the currently selected html template (no echoing).

Returns

string —

The currently selected html template.

addReplacement()

addReplacement(string  $key, string  $value) : \Template

Adds a new replacement to the replacements array.

Parameters

string $key

The value which should be replaced.

string $value

The substitution for the value which should be replaced.

Returns

\Template —

Returns this object for method chaining.

substitute()

substitute(string  $html) : string

Substitutes given strings in some html text.

Parameters

string $html

The html text in which we want to substitute specific strings.

Returns

string —

The html text with substituted values.