replace

Replace Class provided by System to replace placeholders in text and files ${placeholder}.

package

SYSTEM\PAGE

Methods

Replace all placeholders in a text with null.

clean(string $text) : string
static

Effectively removing all Placeholders

Arguments

$text

string

text to be subject of replacements

Response

string

Returns string of the text with all placeholders removed.

Replace all placeholders in a text.

replace(string $text, array $vars = array()) : string
static

Array Key of Placeholders represents the name of the placeholder. The value to the key is filled in.

"Text ${textplaceholder}" array('textplaceholder' => 'test') resolves to: "Text test"

Arguments

$text

string

text to be subject of replacements

$vars

array

Array with Placeholders.

Response

string

Returns string of the text with replaced placeholder.

Replace all placeholders in a file.

replaceFile(string $path, array $vars = array()) : string
static

Array Key of Placeholders represents the name of the placeholder. The value to the key is filled in.

"Text ${textplaceholder}" array('textplaceholder' => 'test') resolves to: "Text test"

Arguments

$path

string

Filepath of file to be subject of replacements

$vars

array

Array with Placeholders.

Response

string

Returns string of the text with replaced placeholder.