$template_class
$template_class : string
name of class used for templates
Class with shared template methodes
$parent : \Smarty_Internal_Template
parent template (if any)
assign(array|string $tpl_var, mixed $value = null, boolean $nocache = false) : \Smarty_Internal_Data
assigns a Smarty variable
| array|string | $tpl_var | the template variable name(s) |
| mixed | $value | the value to assign |
| boolean | $nocache | if true any output of this variable will be not cached |
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
assignGlobal(string $varname, mixed $value = null, boolean $nocache = false) : \Smarty_Internal_Data
assigns a global Smarty variable
| string | $varname | the global variable name |
| mixed | $value | the value to assign |
| boolean | $nocache | if true any output of this variable will be not cached |
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
assignByRef(string $tpl_var, $value, boolean $nocache = false) : \Smarty_Internal_Data
assigns values to template variables by reference
| string | $tpl_var | the template variable name |
| $value | ||
| boolean | $nocache | if true any output of this variable will be not cached |
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
append(array|string $tpl_var, mixed $value = null, boolean $merge = false, boolean $nocache = false) : \Smarty_Internal_Data
appends values to template variables
| array|string | $tpl_var | the template variable name(s) |
| mixed | $value | the value to append |
| boolean | $merge | flag if array elements shall be merged |
| boolean | $nocache | if true any output of this variable will be not cached |
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
appendByRef(string $tpl_var, $value, boolean $merge = false) : \Smarty_Internal_Data
appends values to template variables by reference
| string | $tpl_var | the template variable name |
| $value | ||
| boolean | $merge | flag if array elements shall be merged |
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
getTemplateVars(string $varname = null, string $_ptr = null, boolean $search_parents = true) : string
Returns a single or all template variables
| string | $varname | variable name or null |
| string | $_ptr | optional pointer to data object |
| boolean | $search_parents | include parent templates? |
variable value or or array of variables
clearAssign(string|array $tpl_var) : \Smarty_Internal_Data
clear the given assigned template variable.
| string|array | $tpl_var | the template variable(s) to clear |
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
clearAllAssign() : \Smarty_Internal_Data
clear all the assigned template variables.
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
configLoad(string $config_file, mixed $sections = null) : \Smarty_Internal_Data
load a config file, optionally load just selected sections
| string | $config_file | filename |
| mixed | $sections | array of section names, single section or null |
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
getVariable(string $variable, object $_ptr = null, boolean $search_parents = true, $error_enable = true) : object
gets the object of a Smarty variable
| string | $variable | the name of the Smarty variable |
| object | $_ptr | optional pointer to data object |
| boolean | $search_parents | search also in parent data |
| $error_enable |
the object of the variable
clearConfig(string $varname = null) : \Smarty_Internal_Data
Deassigns a single or all config variables
| string | $varname | variable name or null |
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
fetch(string $template = null, mixed $cache_id = null, mixed $compile_id = null, object $parent = null, boolean $display = false, boolean $merge_tpl_vars = true, boolean $no_output_filter = false) : string
fetches a rendered Smarty template
| string | $template | the resource handle of the template file or template object |
| mixed | $cache_id | cache id to be used with this template |
| mixed | $compile_id | compile id to be used with this template |
| object | $parent | next higher level of Smarty variables |
| boolean | $display | true: display, false: fetch |
| boolean | $merge_tpl_vars | if true parent template variables merged in to local scope |
| boolean | $no_output_filter | if true do not run output filter |
rendered template output
display(string $template = null, mixed $cache_id = null, mixed $compile_id = null, object $parent = null)
displays a Smarty template
| string | $template | the resource handle of the template file or template object |
| mixed | $cache_id | cache id to be used with this template |
| mixed | $compile_id | compile id to be used with this template |
| object | $parent | next higher level of Smarty variables |
isCached(string|object $template = null, mixed $cache_id = null, mixed $compile_id = null, object $parent = null) : boolean
test if cache is valid
| string|object | $template | the resource handle of the template file or template object |
| mixed | $cache_id | cache id to be used with this template |
| mixed | $compile_id | compile id to be used with this template |
| object | $parent | next higher level of Smarty variables |
cache status
registerPlugin(string $type, string $tag, callback $callback, boolean $cacheable = true, array $cache_attr = null)
Registers plugin to be used in templates
| string | $type | plugin type |
| string | $tag | name of template tag |
| callback | $callback | PHP callback to register |
| boolean | $cacheable | if true (default) this fuction is cachable |
| array | $cache_attr | caching attributes if any |
when the plugin tag is invalid
registerResource(string $type, \Smarty_Resource|array $callback)
Registers a resource to fetch a template
| string | $type | name of resource type |
| \Smarty_Resource|array | $callback | or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated) |
registerCacheResource(string $type, \Smarty_CacheResource $callback)
Registers a cache resource to cache a template's output
| string | $type | name of cache resource type |
| \Smarty_CacheResource | $callback | instance of Smarty_CacheResource to handle output caching |
registerObject( $object_name, object $object_impl, array $allowed = array(), boolean $smarty_args = true, array $block_methods = array())
Registers object to be used in templates
| $object_name | ||
| object | $object_impl | the referenced PHP object to register |
| array | $allowed | list of allowed methods (empty = all) |
| boolean | $smarty_args | smarty argument format, else traditional |
| array | $block_methods | list of block-methods |
if any of the methods in $allowed or $block_methods are invalid