HtmlString::translate()
Translates a key or template string and marks the result as trusted HTML. Every filled-in placeholder is escaped, unless its value is already trusted HTML.
HtmlString::translate(array|string $key, array $data = [], array|string|null $fallback = null, string|null $locale = null): HtmlString
Parameters
| Name | Type | Default |
|---|---|---|
| $keyrequired | arrayorstring |
no default value |
| $data | array |
[]
|
| $fallback | arrayorstringornull |
null
|
| $locale | stringornull |
null
|