$template_dir
$template_dir : string
The name of the directory where templates are located.
$cache_modified_check : boolean
Only used when $caching is enabled. If true, then If-Modified-Since headers are respected with cached content, and appropriate HTTP headers are sent.
This way repeated hits to a cached page do not send the entire page to the client every time.
$php_handling : integer
This determines how Smarty handles "<?php .
.. ?>" tags in templates. possible values:
$security : boolean
This enables template security. When enabled, many things are restricted in the templates that normally would go unchecked. This is useful when untrusted parties are editing templates and you want a reasonable level of security. (no direct execution of PHP in templates for example)
$default_resource_type : array
This is the resource type to be used when not specified at the beginning of the resource path. examples: $smarty->display('file:index.tpl'); $smarty->display('db:index.tpl'); $smarty->display('index.tpl'); // will use default resource type {include file="file:index.tpl"} {include file="db:index.tpl"} {include file="index.tpl"} {* will use default resource type *}
$config_read_hidden :
This tells whether hidden sections [.foobar] are readable from the tempalates or not. Normally you would never allow this since that is the point behind hidden sections: the application can access them, but the templates cannot.
register_function(string $function, string $function_impl, $cacheable = true, $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 |
$cacheable | ||
$cache_attrs |
register_object(string $object, $object_impl, null|array $allowed = array(), boolean $smarty_args = true, $block_methods = array())
Registers object to be used in templates
string | $object | name of template object |
$object_impl | ||
null|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 |
is_cached(string $tpl_file, string $cache_id = null, string $compile_id = null) : string|false
test to see if valid cache exists for this template
string | $tpl_file | name of template file |
string | $cache_id | |
string | $compile_id |
results of {@link _read_cache_file()}
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()}
_trigger_fatal_error(string $error_msg, string $tpl_file = null, integer $tpl_line = null, string $file = null, integer $line = null, integer $error_type = E_USER_ERROR)
trigger Smarty plugin error
string | $error_msg | |
string | $tpl_file | |
integer | $tpl_line | |
string | $file | |
integer | $line | |
integer | $error_type |