Class Smarty
This is the main Smarty class
Copyright: 2016 New Digital Group, Inc.
Copyright: 2016 Uwe Tews
Author: Monte Ohrt
Author: Uwe Tews
Author: Rodney Rehm
Located at tpl/smarty/Smarty.class.php
Methods summary
public
|
|
public
boolean
|
|
public
|
#
enableSecurity( string|
Loads security class and enables security |
public
|
|
public
|
|
public
|
#
addTemplateDir( string|array $template_dir, string $key = null, boolean $isConfig = false )
Add template directory(s) |
public
array
|
|
public
|
|
public
|
|
public
array
|
|
public
|
|
public
|
|
public
array
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
object
|
#
createTemplate( string $template, mixed $cache_id = null, mixed $compile_id = null, object $parent = null, boolean $do_clone = true )
creates a template object |
public
string
|
#
loadPlugin( string $plugin_name, boolean $check = true )
Takes unknown classes and loads plugin files for them class name format: Smarty_PluginType_PluginName plugin filename format: plugintype.pluginname.php |
public
string
|
#
_getTemplateId( string $template_name, null|mixed $cache_id = null, null|mixed $compile_id = null, null $caching = null,
Get unique template id |
public
string
|
#
_realpath( string $path, boolean $realpath = null )
Normalize path - remove /./ and /../ - make it absolute if required |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
mixed
|
#
__get( string $name )
< |
public
|
#
__set( string $name, mixed $value )
< |
public static
boolean|
|
#
mutingErrorHandler( integer $errno, $errstr, $errfile, $errline, $errcontext )
Error Handler to mute expected messages |
public static
|
|
public static
|
Methods inherited from Smarty_Internal_TemplateBase
display()
,
fetch()
,
isCached()
,
loadFilter()
,
registerFilter()
,
registerObject()
,
registerPlugin()
,
setCacheId()
,
setCacheLifetime()
,
setCaching()
,
setCompileId()
Methods inherited from Smarty_Internal_Data
__call()
,
_mergeVars()
,
append()
,
appendByRef()
,
assign()
,
assignByRef()
,
assignGlobal()
,
getTemplateVars()
,
getVariable()
Magic methods summary
public
integer
|
|
public
integer
|
#
clearCache( string $template_name, string $cache_id = null, string $compile_id = null, integer $exp_time = null, string $type = null )
|
public
integer
|
#
compileAllTemplates( string $extension = '.tpl', boolean $force_compile = false, integer $time_limit, integer $max_errors = null )
|
public
integer
|
#
compileAllConfig( string $extension = '.conf', boolean $force_compile = false, integer $time_limit, integer $max_errors = null )
|
public
integer
|
Magic methods inherited from Smarty_Internal_TemplateBase
addAutoloadFilters()
,
addDefaultModifier()
,
createData()
,
getAutoloadFilters()
,
getDebugTemplate()
,
getDefaultModifier()
,
getRegisteredObject()
,
getTags()
,
registerCacheResource()
,
registerClass()
,
registerDefaultConfigHandler()
,
registerDefaultPluginHandler()
,
registerDefaultTemplateHandler()
,
registerResource()
,
setAutoloadFilters()
,
setDebugTemplate()
,
setDefaultModifier()
,
unloadFilter()
,
unregisterCacheResource()
,
unregisterFilter()
,
unregisterObject()
,
unregisterPlugin()
,
unregisterResource()
Magic methods inherited from Smarty_Internal_Data
clearAllAssign()
,
clearAssign()
,
clearConfig()
,
configLoad()
,
getConfigVars()
,
getGlobal()
,
getStreamVariable()
Constants summary
string |
SMARTY_VERSION
smarty version |
#
'3.1.30'
|
integer |
SCOPE_LOCAL
define variable scopes |
#
1
|
integer |
SCOPE_PARENT
|
#
2
|
integer |
SCOPE_TPL_ROOT
|
#
4
|
integer |
SCOPE_ROOT
|
#
8
|
integer |
SCOPE_SMARTY
|
#
16
|
integer |
SCOPE_GLOBAL
|
#
32
|
integer |
CACHING_OFF
define caching modes |
#
0
|
integer |
CACHING_LIFETIME_CURRENT
|
#
1
|
integer |
CACHING_LIFETIME_SAVED
|
#
2
|
integer |
CLEAR_EXPIRED
define constant for clearing cache files be saved expiration dates |
#
-1
|
integer |
COMPILECHECK_OFF
define compile check modes |
#
0
|
integer |
COMPILECHECK_ON
|
#
1
|
integer |
COMPILECHECK_CACHEMISS
|
#
2
|
integer |
DEBUG_OFF
define debug modes |
#
0
|
integer |
DEBUG_ON
|
#
1
|
integer |
DEBUG_INDIVIDUAL
|
#
2
|
integer |
PHP_PASSTHRU
modes for handling of "" tags in templates. |
#
0
|
integer |
PHP_QUOTE
|
#
1
|
integer |
PHP_REMOVE
|
#
2
|
integer |
PHP_ALLOW
|
#
3
|
string |
FILTER_POST
filter types |
#
'post'
|
string |
FILTER_PRE
|
#
'pre'
|
string |
FILTER_OUTPUT
|
#
'output'
|
string |
FILTER_VARIABLE
|
#
'variable'
|
string |
PLUGIN_FUNCTION
plugin types |
#
'function'
|
string |
PLUGIN_BLOCK
|
#
'block'
|
string |
PLUGIN_COMPILER
|
#
'compiler'
|
string |
PLUGIN_MODIFIER
|
#
'modifier'
|
string |
PLUGIN_MODIFIERCOMPILER
|
#
'modifiercompiler'
|
integer |
RESOURCE_CACHE_OFF
Resource caching modes (not used since 3.1.30) |
#
0
|
integer |
RESOURCE_CACHE_AUTOMATIC
|
#
1
|
integer |
RESOURCE_CACHE_TEMPLATE
|
#
2
|
integer |
RESOURCE_CACHE_ON
|
#
4
|
Properties summary
public static
array
|
$global_tpl_vars
assigned global tpl vars |
#
array()
|
public static
|
$_previous_error_handler
error handler returned by set_error_handler() in Smarty::muteExpectedErrors() |
#
null
|
public static
array
|
$_muted_directories
contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors() |
#
array()
|
public static
|
$_MBSTRING
Flag denoting if Multibyte String functions are available |
#
SMARTY_MBSTRING
|
public static
|
$_CHARSET
The character set to adhere to (e.g. "UTF-8") |
#
SMARTY_RESOURCE_CHAR_SET
|
public static
|
$_DATE_FORMAT
The date format to be used internally (accepts date() and strftime()) |
#
SMARTY_RESOURCE_DATE_FORMAT
|
public static
string
|
$_UTF8_MODIFIER
Flag denoting if PCRE should run in UTF-8 mode |
#
'u'
|
public static
boolean
|
$_IS_WINDOWS
Flag denoting if operating system is windows |
#
false
|
public
boolean
|
$auto_literal
auto literal on delimiters with whitespace |
#
true
|
public
boolean
|
$error_unassigned
display error on not assigned variables |
#
false
|
public
boolean
|
$use_include_path
look up relative file path in include_path |
#
false
|
protected
array
|
$template_dir
template directory |
#
array('./templates/')
|
protected
array
|
$_processedTemplateDir
flags for normalized template directory entries |
#
array()
|
public
boolean
|
$_templateDirNormalized
flag if template_dir is normalized |
#
false
|
public
string
|
$_joined_template_dir
joined template directory string used in cache keys |
#
null
|
protected
array
|
$config_dir
config directory |
#
array('./configs/')
|
protected
array
|
$_processedConfigDir
flags for normalized template directory entries |
#
array()
|
public
boolean
|
$_configDirNormalized
flag if config_dir is normalized |
#
false
|
public
string
|
$_joined_config_dir
joined config directory string used in cache keys |
#
null
|
public
callable
|
$default_template_handler_func
default template handler |
#
null
|
public
callable
|
$default_config_handler_func
default config handler |
#
null
|
public
callable
|
$default_plugin_handler_func
default plugin handler |
#
null
|
protected
string
|
$compile_dir
compile directory |
#
'./templates_c/'
|
public
boolean
|
$_compileDirNormalized
flag if template_dir is normalized |
#
false
|
protected
array
|
$plugins_dir
plugins directory |
#
array()
|
public
boolean
|
$_pluginsDirNormalized
flag if plugins_dir is normalized |
#
false
|
protected
string
|
$cache_dir
cache directory |
#
'./cache/'
|
public
boolean
|
$_cacheDirNormalized
flag if template_dir is normalized |
#
false
|
public
boolean
|
$force_compile
force template compiling? |
#
false
|
public
boolean
|
$compile_check
check template for modifications? |
#
true
|
public
boolean
|
$use_sub_dirs
use sub dirs for compiled/cached files? |
#
false
|
public
boolean
|
$allow_ambiguous_resources
allow ambiguous resources (that are made unique by the resource handler) |
#
false
|
public
boolean
|
$merge_compiled_includes
merge compiled includes |
#
false
|
public
boolean
|
$force_cache
force cache file creation |
#
false
|
public
string
|
$left_delimiter
template left-delimiter |
#
"{"
|
public
string
|
$right_delimiter
template right-delimiter |
#
"}"
|
public
string
|
$security_class
class name This should be instance of Smarty_Security. |
#
'Smarty_Security'
|
public
|
$security_policy
implementation of security class |
#
null
|
public
integer
|
$php_handling
controls handling of PHP-blocks |
|
public
boolean
|
$allow_php_templates
controls if the php template file resource is allowed |
#
false
|
public
boolean
|
$debugging
debug mode Setting this to true enables the debug-console. |
#
false
|
public
string
|
$debugging_ctrl
This determines if debugging is enable-able from the browser.
|
#
'NONE'
|
public
string
|
$smarty_debug_id
Name of debugging URL-param. Only used when $debugging_ctrl is set to 'URL'. The name of the URL-parameter that activates debugging. |
#
'SMARTY_DEBUG'
|
public
string
|
$debug_tpl
Path of debug template. |
#
null
|
public
integer
|
$error_reporting
When set, smarty uses this value as error_reporting-level. |
#
null
|
public
boolean
|
$config_overwrite
Controls whether variables with the same name overwrite each other. |
#
true
|
public
boolean
|
$config_booleanize
Controls whether config values of on/true/yes and off/false/no get converted to boolean. |
#
true
|
public
boolean
|
$compile_locking
locking concurrent compiles |
#
true
|
public
boolean
|
$cache_locking
Controls whether cache resources should use locking mechanism |
#
false
|
public
float
|
$locking_timeout
seconds to wait for acquiring a lock before ignoring the write lock |
#
10
|
public
string
|
$default_resource_type
resource type used if none given Must be an valid key of $registered_resources. |
#
'file'
|
public
string
|
$caching_type
caching type Must be an element of $cache_resource_types. |
#
'file'
|
public
string
|
$default_config_type
config type |
#
'file'
|
public
boolean
|
$cache_modified_check
check If-Modified-Since headers |
#
false
|
public
array
|
$registered_plugins
registered plugins |
#
array()
|
public
array
|
$registered_objects
registered objects |
#
array()
|
public
array
|
$registered_classes
registered classes |
#
array()
|
public
array
|
$registered_filters
registered filters |
#
array()
|
public
array
|
$registered_resources
registered resources |
#
array()
|
public
array
|
$registered_cache_resources
registered cache resources |
#
array()
|
public
array
|
$autoload_filters
autoload filter |
#
array()
|
public
array
|
$default_modifiers
default modifier |
#
array()
|
public
boolean
|
$escape_html
autoescape variable output |
#
false
|
public
integer
|
$start_time
start time for execution time calculation |
#
0
|
public
string
|
$_current_file
required by the compiler for BC |
#
null
|
public
boolean
|
$_parserdebug
internal flag to enable parser debugging |
#
false
|
public
integer
|
$_objType
This object type (Smarty = 1, template = 2, data = 4) |
#
1
|
public
|
$_debug
Debug object |
#
null
|