Adds string template functionality to any class by providing methods to load and parse string templates.
This trait requires the implementing class to provide a config() method for reading/updating templates. An implementation of this method is provided by Cake\Core\InstanceConfigTrait
Cake\View\StringTemplate|nullStringTemplate instance.
Formats a template string with $data
Gets templates to use or a specific template.
Sets templates to use.
Returns the templater instance.
formatTemplate(string $name, array<string, mixed> $data): string
Formats a template string with $data
string $name The template name.
array<string, mixed> $data The data to insert.
stringgetTemplates(string|null $template = null): array|string
Gets templates to use or a specific template.
string|null $template optional String for reading a specific template, null for all.
array|stringsetTemplates(array<string> $templates): $this
Sets templates to use.
array<string> $templates Templates to be added.
$thistemplater(): Cake\View\StringTemplate
Returns the templater instance.
Cake\View\StringTemplateStringTemplate instance.
Cake\View\StringTemplate|null
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/trait-Cake.View.StringTemplateTrait.html