Less than 1 minute
match_replace
Use the match/replace algorithm on a string to replace mustache tags with view data.
public match_replace({Array})
This is similar code used in the Smarty view template renderer.
So strings such as:
Hello, {{entity}}
will replace with the value of$data->entity
.The quick brown {{animal.one}}, jumped over the lazy {{animal.two}}
will replace the tags with values in a multi-dimensional array.
Parameters
Parameter | Type | Description |
---|---|---|
$string | string | the string to perform the match/replace on |
$data | mixed | the data to use for matching |
$strict | boolean | in strict mode, the function will return NULL if any of the matches are do not exist in data or are NULL |
Generated by Hazaar API Doc Generator