Class Smarty
Indirect known subclasses
Legacy_XoopsTplCopyright: 2001-2005 New Digital Group, Inc.
Author: Monte Ohrt <monte at ohrt dot com>
Author: Andrei Zmievski <andrei@php.net>
Located at xoops_trust_path/libs/smarty/Smarty.class.php
public
|
|
public
|
|
public
|
#
assign_by_ref( string $tpl_var, mixed & $value )
assigns values to template variables by reference |
public
|
|
public
|
#
append_by_ref( string $tpl_var, mixed & $value, $merge = false )
appends values to template variables by reference |
public
|
|
public
|
#
register_function( string $function, string $function_impl, $cacheable = true, $cache_attrs = null )
Registers custom function to be used in templates |
public
|
|
public
|
#
register_object( string $object, object & $object_impl, null|array $allowed = array(), boolean $smarty_args = true, null|array $block_methods = array() )
Registers object to be used in templates |
public
|
|
public
|
#
register_block( string $block, string $block_impl, $cacheable = true, $cache_attrs = null )
Registers block function to be used in templates |
public
|
|
public
|
#
register_compiler_function( string $function, string $function_impl, $cacheable = true )
Registers compiler function |
public
|
|
public
|
#
register_modifier( string $modifier, string $modifier_impl )
Registers modifier to be used in templates |
public
|
|
public
|
|
public
|
|
public
|
#
register_prefilter( callback $function )
Registers a prefilter function to apply to a template before compiling |
public
|
|
public
|
#
register_postfilter( callback $function )
Registers a postfilter function to apply to a compiled template after compilation |
public
|
|
public
|
#
register_outputfilter( callback $function )
Registers an output filter function to apply to a template output |
public
|
|
public
|
|
public
boolean
|
#
clear_cache( string $tpl_file = null, string $cache_id = null, string $compile_id = null, string $exp_time = null )
clear cached content for the given template and cache id |
public
boolean
|
|
public
string|false
|
|
public
|
|
public
boolean
|
#
clear_compiled_tpl( string $tpl_file = null, string $compile_id = null, string $exp_time = null )
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. |
public
boolean
|
|
public
array
&
|
|
public
array
&
|
|
public
|
|
public
|
|
public
|
|
public
|
#
config_load( string $file, string $section = null, string $scope = 'global' )
load configuration values |
public
object
&
|
|
public
|
|
public
string|false
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
#
_compile_source( string $resource_name, string & $source_content, string & $compiled_content, $cache_include_path = null )
compile the given source |
public
string
|
|
public
boolean
|
#
_fetch_resource_info( string & $params )
fetch the template info. Gets timestamp, and source if get_source is true |
public
boolean
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
#
_get_auto_filename( string $auto_base, string $auto_source = null, string $auto_id = null )
get a concrete filename for automagically created content |
public
|
|
public
string|null
|
#
_get_auto_id( string $cache_id = null, string $compile_id = null )
returns an auto_id for auto-file-functions |
public
|
#
_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 |
public
string
|
#
_process_compiled_include_callback( $match )
callback function for preg_replace, to call a non-cacheable block |
public
|
|
public
array
&
|
#
_smarty_cache_attrs( $cache_serial, $count )
get or set an array of cached attributes for function that is not cacheable |
public
mixed
|
|
public
mixed
|
|
public
string
|
public
string
|
$template_dir | 'templates' |
#
The name of the directory where templates are located. |
public
string
|
$compile_dir | 'templates_c' |
#
The directory where compiled templates are located. |
public
string
|
$config_dir | 'configs' |
#
The directory where config files are located. |
public
array
|
$plugins_dir | array('plugins') |
#
An array of directories searched for plugins. |
public
boolean
|
$debugging | false |
#
If debugging is enabled, a debug console window will display when the page loads (make sure your browser allows unrequested popup windows) |
public
integer
|
$error_reporting | null |
#
When set, smarty does uses this value as error_reporting-level. |
public
string
|
$debug_tpl | '' |
#
This is the path to the debug console template. If not set, the default one will be used. |
public
string
|
$debugging_ctrl | 'NONE' |
#
This determines if debugging is enable-able from the browser.
|
public
boolean
|
$compile_check | true |
#
This tells Smarty whether to check for recompiling or not. Recompiling does not need to happen unless a template or config file is changed. Typically you enable this during development, and disable for production. |
public
boolean
|
$force_compile | false |
#
This forces templates to compile every time. Useful for development or debugging. |
public
integer
|
$caching | 0 |
#
This enables template caching.
|
public
string
|
$cache_dir | 'cache' |
#
The name of the directory for cache files. |
public
integer
|
$cache_lifetime | 3600 |
#
This is the number of seconds cached content will persist.
|
public
boolean
|
$cache_modified_check | false |
#
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. |
public
integer
|
$php_handling | SMARTY_PHP_PASSTHRU |
#
This determines how Smarty handles "<?php ... ?>" tags in templates.
possible values:
|
public
boolean
|
$security | false |
#
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) |
public
array
|
$secure_dir | array() |
#
This is the list of template directories that are considered secure. This is
used only if |
public
array
|
$security_settings | array(
'PHP_HANDLING' => false,
'IF_FUNCS' => array('array', 'list',
'isset', 'empty',
'count', 'sizeof',
'in_array', 'is_array',
'true', 'false', 'null'),
'INCLUDE_ANY' => false,
'PHP_TAGS' => false,
'MODIFIER_FUNCS' => array('count'),
'ALLOW_CONSTANTS' => false,
'ALLOW_SUPER_GLOBALS' => true
) |
#
These are the security settings for Smarty. They are used only when |
public
array
|
$trusted_dir | array() |
#
This is an array of directories where trusted php scripts reside. |
public
string
|
$left_delimiter | '{' |
#
The left delimiter used for the template tags. |
public
string
|
$right_delimiter | '}' |
#
The right delimiter used for the template tags. |
public
string
|
$request_vars_order | 'EGPCS' |
#
The order in which request variables are registered, similar to variables_order in php.ini E = Environment, G = GET, P = POST, C = Cookies, S = Server |
public
boolean
|
$request_use_auto_globals | true |
#
Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false) are uses as request-vars or $_*[]-vars. note: if request_use_auto_globals is true, then $request_vars_order has no effect, but the php-ini-value "gpc_order" |
public
string
|
$compile_id | null |
#
Set this if you want different sets of compiled files for the same templates. This is useful for things like different languages. Instead of creating separate sets of templates per language, you set different compile_ids like 'en' and 'de'. |
public
boolean
|
$use_sub_dirs | false |
#
This tells Smarty whether or not to use sub dirs in the cache/ and templates_c/ directories. sub directories better organized, but may not work well with PHP safe mode enabled. |
public
array
|
$default_modifiers | array() |
#
This is a list of the modifiers to apply to all template variables. Put each
modifier in a separate array element in the order you want them applied.
example: |
public
array
|
$default_resource_type | 'file' |
#
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 *} |
public
null|string
|
$cache_handler_func | null |
#
The function used for cache file handling. If not set, built-in caching is used. |
public
array
|
$autoload_filters | array() |
#
This indicates which filters are automatically loaded into Smarty. |
public
boolean
|
$config_overwrite | true |
#
This tells if config file vars of the same name overwrite each other or not. if disabled, same name variables are accumulated in an array. |
public
boolean
|
$config_booleanize | true |
#
This tells whether or not to automatically booleanize config file variables. If enabled, then the strings "on", "true", and "yes" are treated as boolean true, and "off", "false" and "no" are treated as boolean false. |
public
boolean
|
$config_fix_newlines | true |
#
This tells whether or not automatically fix newlines in config files. It basically converts \r (mac) or \r\n (dos) to \n |
public
string
|
$default_template_handler_func | '' |
#
If a template cannot be found, this PHP function will be executed. Useful for creating templates on-the-fly or other special action. |
public
string
|
$compiler_file | 'Smarty_Compiler.class.php' |
#
The file that contains the compiler class. This can a full pathname, or relative to the php_include path. |
public
string
|
$compiler_class | 'Smarty_Compiler' |
#
The class used for compiling templates. |
public
string
|
$config_class | 'Config_File' |
#
The class used to load config vars. |
public
array
|
$_tpl_vars | array() |
#
where assigned template vars are kept |
public
null|array
|
$_smarty_vars | null |
#
stores run-time $smarty.* vars |
public
array
|
$_sections | array() |
#
keeps track of sections |
public
array
|
$_foreach | array() |
#
keeps track of foreach blocks |
public
array
|
$_tag_stack | array() |
#
keeps track of tag hierarchy |
public
Config_file
|
$_conf_obj | null |
#
configuration object |
public
array
|
$_config | array(array('vars' => array(), 'files' => array())) |
#
loaded configuration settings |
public
string
|
$_smarty_md5 | 'f8d698aea36fcbead2b9d5359ffca76f' |
#
md5 checksum of the string 'Smarty' |
public
string
|
$_version | '2.6.26' |
#
Smarty version number |
public
integer
|
$_inclusion_depth | 0 |
#
current template inclusion depth |
public
string
|
$_compile_id | null |
#
for different compiled templates |
public
string
|
$_smarty_debug_id | 'SMARTY_DEBUG' |
#
text in URL to enable debug mode |
public
array
|
$_smarty_debug_info | array() |
#
debugging information for debug console |
public
array
|
$_cache_info | array() |
#
info that makes up a cache file |
public
integer
|
$_file_perms | 0644 |
#
default file permissions |
public
integer
|
$_dir_perms | 0771 |
#
default dir permissions |
public
array
|
$_reg_objects | array() |
#
registered objects |
public
array
|
$_plugins | array(
'modifier' => array(),
'function' => array(),
'block' => array(),
'compiler' => array(),
'prefilter' => array(),
'postfilter' => array(),
'outputfilter' => array(),
'resource' => array(),
'insert' => array()) |
#
table keeping track of plugins |
public
array
|
$_cache_serials | array() |
#
cache serials |
public
string
|
$_cache_include | null |
#
name of optional cache include file |
public
string
|
$_cache_including | false |
#
indicate if the current code is used in a compiled include |