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
StringTemplate instance.
formatTemplate(string $name, array $data)
Formats a template string with $data
string
$name The template name.
array
$data The data to insert.
string
getTemplates(?string $template)
Gets templates to use or a specific template.
string|null
$template optional String for reading a specific template, null for all.
string|array
setTemplates(array $templates)
Sets templates to use.
string[]
$templates Templates to be added.
$this
templater()
Returns the templater instance.
\Cake\View\StringTemplate
StringTemplate instance.
\Cake\View\StringTemplate
© 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.1/trait-Cake.View.StringTemplateTrait.html