SMARTY_VERSION
SMARTY_VERSION = '3.1.31'
smarty version
This is the main Smarty class
$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
$security_policy : \Smarty_Security
implementation of security class
$config_read_hidden : boolean
Controls whether hidden config sections/vars are read from the file.
$_debug : \Smarty_Internal_Debug
Debug object
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 |
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 |
templateExists(string $resource_name) : boolean
Check if a template resource exists
string | $resource_name | template name |
status
None found |
enableSecurity(string|\Smarty_Security $security_class = null) : \Smarty
Loads security class and enables security
string|\Smarty_Security | $security_class | if a string is used, it must be class-name |
when an invalid class name is provided
current Smarty instance for chaining
None found |
disableSecurity() : \Smarty
Disable security
current Smarty instance for chaining
None found |
setTemplateDir(string|array $template_dir, boolean $isConfig = false) : \Smarty
Set template directory
string|array | $template_dir | directory(s) of template sources |
boolean | $isConfig | true for config_dir |
current Smarty instance for chaining
None found |
addTemplateDir(string|array $template_dir, string $key = null, boolean $isConfig = false) : \Smarty
Add template directory(s)
string|array | $template_dir | directory(s) of template sources |
string | $key | of the array element to assign the template dir to |
boolean | $isConfig | true for config_dir |
current Smarty instance for chaining
None found |
getTemplateDir(mixed $index = null, boolean $isConfig = false) : array
Get template directories
mixed | $index | index of directory to get, null to get all |
boolean | $isConfig | true for config_dir |
list of template directories, or directory of $index
None found |
setConfigDir( $config_dir) : \Smarty
Set config directory
$config_dir |
current Smarty instance for chaining
None found |
addConfigDir(string|array $config_dir, mixed $key = null) : \Smarty
Add config directory(s)
string|array | $config_dir | directory(s) of config sources |
mixed | $key | key of the array element to assign the config dir to |
current Smarty instance for chaining
None found |
getConfigDir(mixed $index = null) : array
Get config directory
mixed | $index | index of directory to get, null to get all |
configuration directory
None found |
setPluginsDir(string|array $plugins_dir) : \Smarty
Set plugins directory
string|array | $plugins_dir | directory(s) of plugins |
current Smarty instance for chaining
None found |
addPluginsDir(null|array $plugins_dir) : \Smarty
Adds directory of plugin files
null|array | $plugins_dir |
current Smarty instance for chaining
None found |
getPluginsDir() : array
Get plugin directories
list of plugin directories
None found |
setCompileDir(string $compile_dir) : \Smarty
string | $compile_dir | directory to store compiled templates in |
current Smarty instance for chaining
None found |
getCompileDir() : string
Get compiled directory
path to compiled templates
None found |
setCacheDir(string $cache_dir) : \Smarty
Set cache directory
string | $cache_dir | directory to store cached templates in |
current Smarty instance for chaining
None found |
None found |
createTemplate(string $template, mixed $cache_id = null, mixed $compile_id = null, object $parent = null, boolean $do_clone = true) : object
creates a template object
string | $template | the resource handle of the template file |
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 | $do_clone | flag is Smarty object shall be cloned |
template object
None found |
loadPlugin(string $plugin_name, boolean $check = true) : string
Takes unknown classes and loads plugin files for them class name format: Smarty_PluginType_PluginName plugin filename format: plugintype.pluginname.php
string | $plugin_name | class plugin name to load |
boolean | $check | check if already loaded |
|boolean filepath of loaded file or false
None found |
_getTemplateId(string $template_name, null|mixed $cache_id = null, null|mixed $compile_id = null, null $caching = null, \Smarty_Internal_Template $template = null) : string
Get unique template id
string | $template_name | |
null|mixed | $cache_id | |
null|mixed | $compile_id | |
null | $caching | |
\Smarty_Internal_Template | $template |
None found |
_realpath(string $path, boolean $realpath = null) : string
Normalize path - remove /./ and /.
./
string | $path | file path |
boolean | $realpath | if true - convert to absolute false - convert to relative null - keep as it is but remove /./ /../ |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
setMergeCompiledIncludes(boolean $merge_compiled_includes)
boolean | $merge_compiled_includes |
None found |
None found |
None found |
None found |
setConfigOverwrite(boolean $config_overwrite)
boolean | $config_overwrite |
None found |
setConfigBooleanize(boolean $config_booleanize)
boolean | $config_booleanize |
None found |
setConfigReadHidden(boolean $config_read_hidden)
boolean | $config_read_hidden |
None found |
None found |
setDefaultResourceType(string $default_resource_type)
string | $default_resource_type |
None found |
None found |
None found |
__get(string $name) : mixed
<<magic>> Generic getter.
Calls the appropriate getter function. Issues an E_USER_NOTICE if no valid getter is found.
string | $name | property name |
None found |
__set(string $name, mixed $value)
<<magic>> Generic setter.
Calls the appropriate setter function. Issues an E_USER_NOTICE if no valid setter is found.
string | $name | property name |
mixed | $value | parameter passed to setter |
None found |
mutingErrorHandler(integer $errno, $errstr, $errfile, $errline, $errcontext) : boolean|void
Error Handler to mute expected messages
integer | $errno | Error level |
$errstr | ||
$errfile | ||
$errline | ||
$errcontext |
None found |
None found |
None found |
clearAllCache(integer $exp_time = null, string $type = null) : integer
integer | $exp_time | |
string | $type |
None found |
clearCache(string $template_name, string $cache_id = null, string $compile_id = null, integer $exp_time = null, string $type = null) : integer
string | $template_name | |
string | $cache_id | |
string | $compile_id | |
integer | $exp_time | |
string | $type |
None found |
compileAllTemplates(string $extension = '.tpl', boolean $force_compile = false, integer $time_limit, integer $max_errors = null) : integer
string | $extension | |
boolean | $force_compile | |
integer | $time_limit | |
integer | $max_errors |
None found |
compileAllConfig(string $extension = '.conf', boolean $force_compile = false, integer $time_limit, integer $max_errors = null) : integer
string | $extension | |
boolean | $force_compile | |
integer | $time_limit | |
integer | $max_errors |
None found |
clearCompiledTemplate(mixed $resource_name = null, mixed $compile_id = null, mixed $exp_time = null) : integer
mixed | $resource_name | |
mixed | $compile_id | |
mixed | $exp_time |
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 |
_normalizeDir(string $dirName, string $dir)
Normalize and set directory string
string | $dirName | cache_dir or compile_dir |
string | $dir | filepath of folder |
None found |
_nomalizeTemplateConfig(boolean $isConfig)
Normalize template_dir or config_dir
boolean | $isConfig | true for config_dir |
None found |