$cache_id
$cache_id : string
Set this if you want different sets of cache files for the same templates.
Main class with template data structures and methods
$tpl_vars : array<mixed,\Smarty_Variable>
template variables
$parent : \Smarty|\Smarty_Internal_Template|\Smarty_Internal_Data
parent template (if any)
$ext : \Smarty_Internal_Extension_Handler
extension handler
$smarty : \Smarty
Global smarty instance
$source : \Smarty_Template_Source|\Smarty_Template_Config
Source instance
$inheritance : \Smarty_Internal_Runtime_Inheritance
Inheritance runtime extension
$tplObjCache : array<mixed,\Smarty_Internal_Template>
Template object cache
$isCacheTplObj : array<mixed,\Smarty_Internal_Template>
Template object cache for Smarty::isCached() == true
fetch(string $template = null, mixed $cache_id = null, mixed $compile_id = null, object $parent = null) : 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 |
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(null|string|\Smarty_Internal_Template $template = null, mixed $cache_id = null, mixed $compile_id = null, object $parent = null) : boolean
test if cache is valid
null|string|\Smarty_Internal_Template | $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 $name, callback $callback, boolean $cacheable = true, mixed $cache_attr = null) : \Smarty|\Smarty_Internal_Template
Registers plugin to be used in templates
string | $type | plugin type |
string | $name | name of template tag |
callback | $callback | PHP callback to register |
boolean | $cacheable | if true (default) this function is cache able |
mixed | $cache_attr | caching attributes if any |
when the plugin tag is invalid
registerFilter(string $type, callback $callback, string|null $name = null) : \Smarty|\Smarty_Internal_Template
Registers a filter function
string | $type | filter type |
callback | $callback | |
string|null | $name | optional filter name |
registerObject(string $object_name, object $object, array $allowed_methods_properties = array(), boolean $format = true, array $block_methods = array()) : \Smarty|\Smarty_Internal_Template
Registers object to be used in templates
string | $object_name | |
object | $object | the referenced PHP object to register |
array | $allowed_methods_properties | list of allowed methods (empty = all) |
boolean | $format | smarty argument format, else traditional |
array | $block_methods | list of block-methods |
__construct(string $template_resource, \Smarty $smarty, null|\Smarty_Internal_Template|\Smarty|\Smarty_Internal_Data $_parent = null, mixed $_cache_id = null, mixed $_compile_id = null, boolean|integer|null $_caching = null, integer|null $_cache_lifetime = null, boolean $_isConfig = false)
Create template data object Some of the global Smarty settings copied to template scope It load the required template resources and caching plugins
string | $template_resource | template resource string |
\Smarty | $smarty | Smarty instance |
null|\Smarty_Internal_Template|\Smarty|\Smarty_Internal_Data | $_parent | back pointer to parent object with variables or null |
mixed | $_cache_id | cache id or null |
mixed | $_compile_id | compile id or null |
boolean|integer|null | $_caching | use caching? |
integer|null | $_cache_lifetime | cache life-time in seconds |
boolean | $_isConfig |
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
append(array|string $tpl_var, mixed $value = null, boolean $merge = false, boolean $nocache = false) : \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
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 |
assignGlobal(string $varName, mixed $value = null, boolean $nocache = false) : \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
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 |
appendByRef(string $tpl_var, $value, boolean $merge = false) : \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
appends values to template variables by reference
string | $tpl_var | the template variable name |
$value | ||
boolean | $merge | flag if array elements shall be merged |
assignByRef(string $tpl_var, $value, boolean $nocache = false) : \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
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 |
getTemplateVars(string $varName = null, \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr = null, boolean $searchParents = true) : mixed
Returns a single or all template variables
string | $varName | variable name or null |
\Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty | $_ptr | optional pointer to data object |
boolean | $searchParents | include parent templates? |
variable value or or array of variables
getVariable(string $variable = null, \Smarty_Internal_Data $_ptr = null, boolean $searchParents = true, boolean $error_enable = true) : \Smarty_Variable|\Smarty_Undefined_Variable
gets the object of a Smarty variable
string | $variable | the name of the Smarty variable |
\Smarty_Internal_Data | $_ptr | optional pointer to data object |
boolean | $searchParents | search also in parent data |
boolean | $error_enable |
the object of the variable
_mergeVars(\Smarty_Internal_Data|null $data = null)
Follow the parent chain an merge template and config variables
\Smarty_Internal_Data|null | $data |
None found |
None found |
None found |
_isSmartyObj() : boolean
Return true if this instance is a Smarty obj
None found |
_getSmartyObj() : \Smarty
Get Smarty object
None found |
__call(string $name, array $args) : mixed
Handle unknown class methods
string | $name | unknown method-name |
array | $args | argument array |
None found |
render(boolean $no_output_filter = true, null|boolean $display = null) : string
render template
boolean | $no_output_filter | if true do not run output filter |
null|boolean | $display | true: display, false: fetch null: sub-template |
None found |
_subTemplateRender(string $template, mixed $cache_id, mixed $compile_id, integer $caching, integer $cache_lifetime, array $data, integer $scope, boolean $forceTplCache, string $uid = null, string $content_func = null)
Runtime function to render sub-template
string | $template | template name |
mixed | $cache_id | cache id |
mixed | $compile_id | compile id |
integer | $caching | cache mode |
integer | $cache_lifetime | life time of cache data |
array | $data | passed parameter template variables |
integer | $scope | scope in which {include} should execute |
boolean | $forceTplCache | cache template object |
string | $uid | file dependency uid |
string | $content_func | function name |
None found |
None found |
_isSubTpl() : boolean
Check if this is a sub template
true is sub template
None found |
_assignInScope(string $varName, mixed $value, boolean $nocache = false, integer $scope)
Assign variable in scope
string | $varName | variable name |
mixed | $value | value |
boolean | $nocache | nocache flag |
integer | $scope | scope into which variable shall be assigned |
None found |
_decodeProperties(\Smarty_Internal_Template $tpl, array $properties, boolean $cache = false) : boolean
This function is executed automatically when a compiled or cached template file is included - Decode saved properties from compiled template and cache files - Check if compiled or cache file is valid
\Smarty_Internal_Template | $tpl | |
array | $properties | special template properties |
boolean | $cache | flag if called from cache file |
flag if compiled or cache file is valid
None found |
compileTemplateSource()
Compiles the template If the template is not evaluated the compiled template is saved on disk
None found |
writeCachedContent(string $content) : boolean
Writes the content to cache resource
string | $content |
None found |
None found |
None found |
loadCompiled(boolean $force = false)
Load compiled object
boolean | $force | force new compiled object |
None found |
loadCached(boolean $force = false)
Load cached object
boolean | $force | force new cached object |
None found |
None found |
None found |
None found |
__set(string $property_name, mixed $value)
set Smarty property in template context
string | $property_name | property name |
mixed | $value | value |
None found |
__get(string $property_name) : mixed|\Smarty_Template_Cached
get Smarty property in template context
string | $property_name | property name |
None found |
None found |
None found |
addAutoloadFilters(mixed $filters, string $type = null) : \Smarty_Internal_TemplateBase
mixed | $filters | |
string | $type |
None found |
addDefaultModifier(mixed $modifiers) : \Smarty_Internal_TemplateBase
mixed | $modifiers |
None found |
createData(\Smarty_Internal_Data $parent = null, string $name = null) : \Smarty_Internal_TemplateBase
\Smarty_Internal_Data | $parent | |
string | $name |
None found |
getAutoloadFilters(string $type = null) : array
string | $type |
None found |
None found |
None found |
None found |
getRegisteredObject(string $object_name) : object
string | $object_name |
None found |
registerCacheResource(string $name, \Smarty_CacheResource $resource_handler) : \Smarty_Internal_TemplateBase
string | $name | |
\Smarty_CacheResource | $resource_handler |
None found |
registerClass(string $class_name, string $class_impl) : \Smarty_Internal_TemplateBase
string | $class_name | |
string | $class_impl |
None found |
registerDefaultConfigHandler(callback $callback) : \Smarty_Internal_TemplateBase
callback | $callback |
None found |
registerDefaultPluginHandler(callback $callback) : \Smarty_Internal_TemplateBase
callback | $callback |
None found |
registerDefaultTemplateHandler(callback $callback) : \Smarty_Internal_TemplateBase
callback | $callback |
None found |
registerResource(string $name, mixed $resource_handler) : \Smarty_Internal_TemplateBase
string | $name | |
mixed | $resource_handler |
None found |
setAutoloadFilters(mixed $filters, string $type = null) : \Smarty_Internal_TemplateBase
mixed | $filters | |
string | $type |
None found |
setDebugTemplate(string $tpl_name) : \Smarty_Internal_TemplateBase
string | $tpl_name |
None found |
setDefaultModifier(mixed $modifiers) : \Smarty_Internal_TemplateBase
mixed | $modifiers |
None found |
unloadFilter(string $type, string $name) : \Smarty_Internal_TemplateBase
string | $type | |
string | $name |
None found |
unregisterCacheResource(string $name) : \Smarty_Internal_TemplateBase
string | $name |
None found |
unregisterObject(string $object_name) : \Smarty_Internal_TemplateBase
string | $object_name |
None found |
unregisterPlugin(string $type, string $name) : \Smarty_Internal_TemplateBase
string | $type | |
string | $name |
None found |
unregisterFilter(string $type, mixed $callback) : \Smarty_Internal_TemplateBase
string | $type | |
mixed | $callback |
None found |
unregisterResource(string $name) : \Smarty_Internal_TemplateBase
string | $name |
None found |
None found |
getConfigVariable(string $varName, boolean $errorEnable = true) : mixed
string | $varName | |
boolean | $errorEnable |
None found |
getConfigVars(string $varName = null, boolean $searchParents = true) : mixed
string | $varName | |
boolean | $searchParents |
None found |
None found |
getStreamVariable(string $variable) : mixed
string | $variable |
None found |
clearAssign(mixed $tpl_var) : \Smarty_Internal_Data
mixed | $tpl_var |
None found |
None found |
clearConfig(string $varName = null) : \Smarty_Internal_Data
string | $varName |
None found |
configLoad(string $config_file, mixed $sections = null, string $scope = 'local') : \Smarty_Internal_Data
string | $config_file | |
mixed | $sections | |
string | $scope |
None found |
_execute(string $template, mixed $cache_id, mixed $compile_id, object $parent, string $function) : mixed
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 |
string | $function | function type 0 = fetch, 1 = display, 2 = isCache |
None found |