On this page
Trait StringTemplateTrait
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
Direct Users
- Cake\View\Helper\BreadcrumbsHelper
 - Cake\View\Helper\FormHelper
 - Cake\View\Helper\HtmlHelper
 - Cake\View\Helper\PaginatorHelper
 - Cake\View\Helper\TimeHelper
 
Properties summary
- 
    StringTemplate instance.
$_templaterprotected 
Method Summary
- 
    formatTemplate() publicFormat a template string with $data
 - 
    templater() publictemplater
 - 
    templates() publicGet/set templates to use.
 
Method Detail
formatTemplate()source public
formatTemplate( string $name , array $data )
   Format a template string with $data
Parameters
- 
     string 
$name - The template name.
 - 
     array 
$data - The data to insert.
 
Returns
stringtemplates()source public
templates( string|null|array $templates null )
   Get/set templates to use.
Parameters
- 
     string|null|array 
$templatesoptional null - 
     
null or string allow reading templates. An array allows templates to be added.
 
Returns
$this|string|array
Properties detail
© 2005–2017 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/3.3/class-Cake.View.StringTemplateTrait.html