Manages a string substitution set

author etessore
version 1.0.0
package classes

 Methods

Initializes the current object with default parameters

__construct() 

Replaces the markup in $this->tpl %tag%s with the one in the corresponding value of $this->static_markup[tag].

replace_markup() 

Set the static markup; ie: prev\next\loading divs

set_markup(string | array $key, string | array $markup) : \SubstitutionTemplate

Parameters

$key

stringarray

the searches to be substituted

$markup

stringarray

html markups

Exceptions

\Exception if $key and $markup have different number of elements

Returns

\SubstitutionTemplate$this for chainability

Bulk set the key:markup pairs

set_multi_markup(array $ass_array) 

Parameters

$ass_array

array

an associative array of keys and markups

Sets the substitutions template

set_tpl(string $tpl) 

Parameters

$tpl

string

the template

 Properties

 

Stores some static html

$static_markup : array
 

the substitution template

$tpl : string