Tags
class Tags extends StringMutator (View source)
Replaces tags {{ tag }}
in a string with values from a map.
Available options:
forceLowerCaseKeys
(bool): Force all keys to be lower case. Defaults tofalse
.throwWhenMissing
(bool): Throw an exception when a tag is missing. Defaults tofalse
.removeOnMissing
(mixed): Remove the tag when it is missing. Defaults tofalse
.
Example:
$tags = [
'name' => 'General Kenobi',
];
Tags::make($tags)->mutate('Hello there, {{ name }}!'); // 'Hello there, General Kenobi!'
Traits
Methods
__construct(array $tags, array $options = [])
No description
string
mutateString(string $value)
No description
Details
__construct(array $tags, array $options = [])
No description
static Tags
make(array $tags, array $options = [])
No description
final mixed
mutate(mixed $value)
Mutate the input value.
protected string
mutateString(string $value)
No description
protected string
resolveStringInput(mixed $value)
No description