Property | Type | Description | |
---|---|---|---|
$_compactAttributes | array | List of attributes that can be made compact. | |
$_compiled | array | Contains the list of compiled templates | |
$_configStack | array | A stack of template sets that have been stashed temporarily. | |
$_defaultConfig | array | The default templates this instance holds. |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) | Constructor. | |
add ( array $templates ) | Registers a list of templates by name | |
format ( string $name, array $data ) : string | null | Format a template string with $data | |
formatAttributes ( array | null $options, array | null $exclude = null ) : string | Returns a space-delimited string with items of the $options array. If a key of $options array happens to be one of those listed in StringTemplate::$_compactAttributes and its value is one of: | |
get ( ) | ||
load ( string $file ) : void | Load a config file containing templates. | |
pop ( ) : void | Restore the most recently pushed set of templates. | |
push ( ) : void | Push the current templates into the template stack. | |
remove ( string $name ) : void | Remove the named template. |
Method | Description | |
---|---|---|
_compileTemplates ( array $templates = [] ) : void | Compile templates into a more efficient printf() compatible format. | |
_formatAttribute ( string $key, string | array $value, boolean $escape = true ) : string | Formats an individual attribute, and returns the string value of the composed attribute. |
public __construct ( array $config = [] ) | ||
$config | array | A set of templates to add. |
protected _compileTemplates ( array $templates = [] ) : void | ||
$templates | array | The template names to compile. If empty all templates will be compiled. |
return | void |
protected array $_compactAttributes | ||
return | array |
protected array $_compiled | ||
return | array |
protected array $_configStack | ||
return | array |
protected array $_defaultConfig | ||
return | array |