SMARTY_VERSION
SMARTY_VERSION = 'Smarty-3.1.6'
smarty version
Smarty Backward Compatability Wrapper Class
$security_policy : \Smarty_Security
implementation of security class
$config_read_hidden : boolean
Controls whether hidden config sections/vars are read from the file.
$smarty : \Smarty
self pointer to Smarty object
$parent : \Smarty_Internal_Template
parent template (if any)
clearCache(string $template_name, string $cache_id = null, string $compile_id = null, integer $exp_time = null, string $type = null) : integer
Empty cache for a specific template
string | $template_name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
integer | $exp_time | expiration time |
string | $type | resource type |
number of cache files deleted
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
disableSecurity() : \Smarty
Disable security
current Smarty instance for chaining
setTemplateDir(string|array $template_dir) : \Smarty
Set template directory
string|array | $template_dir | directory(s) of template sources |
current Smarty instance for chaining
addTemplateDir(string|array $template_dir, string $key = null) : \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 |
when the given template directory is not valid
current Smarty instance for chaining
setConfigDir( $config_dir) : \Smarty
Set config directory
$config_dir |
current Smarty instance for chaining
addConfigDir(string|array $config_dir, $key = null) : \Smarty
Add config directory(s)
string|array | $config_dir | directory(s) of config sources |
$key |
current Smarty instance for chaining
setPluginsDir(string|array $plugins_dir) : \Smarty
Set plugins directory
string|array | $plugins_dir | directory(s) of plugins |
current Smarty instance for chaining
addPluginsDir( $plugins_dir) : \Smarty
Adds directory of plugin files
$plugins_dir |
current Smarty instance for chaining
setCompileDir(string $compile_dir) : \Smarty
Set compile directory
string | $compile_dir | directory to store compiled templates in |
current Smarty instance for chaining
setCacheDir(string $cache_dir) : \Smarty
Set cache directory
string | $cache_dir | directory to store cached templates in |
current Smarty instance for chaining
setDefaultModifiers(array|string $modifiers) : \Smarty
Set default modifiers
array|string | $modifiers | modifier or list of modifiers to set |
current Smarty instance for chaining
addDefaultModifiers(array|string $modifiers) : \Smarty
Add default modifiers
array|string | $modifiers | modifier or list of modifiers to add |
current Smarty instance for chaining
setAutoloadFilters(array $filters, string $type = null) : \Smarty
Set autoload filters
array | $filters | filters to load automatically |
string | $type | "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types |
current Smarty instance for chaining
addAutoloadFilters(array $filters, string $type = null) : \Smarty
Add autoload filters
array | $filters | filters to load automatically |
string | $type | "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types |
current Smarty instance for chaining
getAutoloadFilters(string $type = null) : array
Get autoload filters
string | $type | type of filter to get autoloads for. Defaults to all autoload filters |
array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified
setDebugTemplate(string $tpl_name) : \Smarty
set the debug template
string | $tpl_name |
if file is not readable
current Smarty instance for chaining
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
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
compileAllTemplates( $extention = '.tpl', boolean $force_compile = false, integer $time_limit, integer $max_errors = null) : integer
Compile all template files
$extention | ||
boolean | $force_compile | force all to recompile |
integer | $time_limit | |
integer | $max_errors |
number of template files recompiled
compileAllConfig( $extention = '.conf', boolean $force_compile = false, integer $time_limit, integer $max_errors = null) : integer
Compile all config files
$extention | ||
boolean | $force_compile | force all to recompile |
integer | $time_limit | |
integer | $max_errors |
number of template files recompiled
clearCompiledTemplate(string $resource_name = null, string $compile_id = null, integer $exp_time = null) : integer
Delete compiled template file
string | $resource_name | template name |
string | $compile_id | compile id |
integer | $exp_time | expiration time |
number of template files deleted
getTags(\Smarty_Internal_Template $template) : array
Return array of tag/attributes of all tags used by an template
\Smarty_Internal_Template | $template |
of tag/attributes
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
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
register_function(string $function, string $function_impl, boolean $cacheable = true, mixed $cache_attrs = null)
Registers custom function to be used in templates
string | $function | the name of the template function |
string | $function_impl | the name of the PHP function to register |
boolean | $cacheable | |
mixed | $cache_attrs |
register_object(string $object, object $object_impl, array $allowed = array(), boolean $smarty_args = true, $block_methods = array())
Registers object to be used in templates
string | $object | name of template object |
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 |
$block_methods |
clear_cache(string $tpl_file = null, string $cache_id = null, string $compile_id = null, string $exp_time = null) : boolean
clear cached content for the given template and cache id
string | $tpl_file | name of template file |
string | $cache_id | name of cache_id |
string | $compile_id | name of compile_id |
string | $exp_time | expiration time |
clear_compiled_tpl(string $tpl_file = null, string $compile_id = null, string $exp_time = null) : boolean
clears compiled version of specified template resource, or all compiled template files if one is not specified.
This function is for advanced use only, not normally needed.
string | $tpl_file | |
string | $compile_id | |
string | $exp_time |
results of {@link smarty_core_rm_auto()}