Reference

Str::template()

Replaces placeholders in string with value from array

Str::template(string $string = null, array $data = [ ], string $fallback = null, string $start = '{{', string $end = '}}'): string

Parameters

Name Type Default Description
$string string null

The string with placeholders

$data array [ ]

Associative array with placeholders as
keys and replacements as values

$fallback string null

A fallback if a token does not have any matches

$start string '{{'
$end string '}}'

Return type

string

Source code

kirby/src/Toolkit/Str.php#L848