Template
in package
Basic template engine used for generating initial Cept/Cest/Test files.
Table of Contents
Properties
- $placeholderEnd : mixed
- $placeholderStart : mixed
- $template : mixed
- $vars : mixed
Methods
- __construct() : mixed
- Takes a template string
- getVar() : mixed
- place() : $this
- Replaces {{var}} string with provided value
- produce() : mixed
- Fills up template string with placed variables.
- setVars() : mixed
- Sets all template vars
Properties
$placeholderEnd
protected
mixed
$placeholderEnd
$placeholderStart
protected
mixed
$placeholderStart
$template
protected
mixed
$template
$vars
protected
mixed
$vars
= []
Methods
__construct()
Takes a template string
public
__construct(mixed $template[, mixed $placeholderStart = '{{' ][, mixed $placeholderEnd = '}}' ]) : mixed
Parameters
- $template : mixed
- $placeholderStart : mixed = '{{'
- $placeholderEnd : mixed = '}}'
getVar()
public
getVar(mixed $name) : mixed
Parameters
- $name : mixed
place()
Replaces {{var}} string with provided value
public
place(mixed $var, mixed $val) : $this
Parameters
- $var : mixed
- $val : mixed
Return values
$thisproduce()
Fills up template string with placed variables.
public
produce() : mixed
setVars()
Sets all template vars
public
setVars(array<string|int, mixed> $vars) : mixed
Parameters
- $vars : array<string|int, mixed>