Methods |
public
|
__construct()
Initialize new Smarty object
Initialize new Smarty object
Overrides
Overriden by
|
#
|
public
static
|
muteExpectedErrors(): boolean
Enable error handler to mute expected messages
Enable error handler to mute expected messages
|
#
|
public
static
|
unmuteExpectedErrors()
Disable error handler muting expected messages
Disable error handler muting expected messages
|
#
|
public
|
templateExists(string $resource_name): bool
Check if a template resource exists
Check if a template resource exists
Parameters
$resource_name |
template name
|
Returns
Throws
|
#
|
public
|
enableSecurity(string|Smarty_Security $security_class = null): Smarty
Loads security class and enables security
Loads security class and enables security
Parameters
$security_class |
if a string is used, it must be class-name
|
Returns
current Smarty instance for chaining
Throws
|
#
|
public
|
disableSecurity(): Smarty
Disable security
Returns
current Smarty instance for chaining
|
#
|
public
|
addTemplateDir(string|array $template_dir, string $key = null, bool $isConfig = false): Smarty
Add template directory(s)
Add template directory(s)
Parameters
$template_dir |
directory(s) of template sources
|
$key |
of the array element to assign the template dir to
|
$isConfig |
true for config_dir
|
Returns
current Smarty instance for chaining
|
#
|
public
|
getTemplateDir(mixed $index = null, bool $isConfig = false): array|string
Get template directories
Parameters
$index |
index of directory to get, null to get all
|
$isConfig |
true for config_dir
|
Returns
list of template directories, or directory of $index
|
#
|
public
|
setTemplateDir(string|array $template_dir, bool $isConfig = false): Smarty
Set template directory
Parameters
$template_dir |
directory(s) of template sources
|
$isConfig |
true for config_dir
|
Returns
current Smarty instance for chaining
|
#
|
public
|
addConfigDir(string|array $config_dir, mixed $key = null): Smarty
Add config directory(s)
Parameters
$config_dir |
directory(s) of config sources
|
$key |
key of the array element to assign the config dir to
|
Returns
current Smarty instance for chaining
|
#
|
public
|
getConfigDir(mixed $index = null): array
Get config directory
Parameters
$index |
index of directory to get, null to get all
|
Returns
|
#
|
public
|
setConfigDir($config_dir): Smarty
Set config directory
Returns
current Smarty instance for chaining
|
#
|
public
|
addPluginsDir(null|array|string $plugins_dir): Smarty
Adds directory of plugin files
Adds directory of plugin files
Returns
current Smarty instance for chaining
|
#
|
public
|
getPluginsDir(): array
Get plugin directories
Returns
list of plugin directories
|
#
|
public
|
setPluginsDir(string|array $plugins_dir): Smarty
Set plugins directory
Parameters
$plugins_dir |
directory(s) of plugins
|
Returns
current Smarty instance for chaining
|
#
|
public
|
getCompileDir(): string
Get compiled directory
Returns
path to compiled templates
|
#
|
public
|
setCompileDir(string $compile_dir): Smarty
Parameters
$compile_dir |
directory to store compiled templates in
|
Returns
current Smarty instance for chaining
|
#
|
public
|
getCacheDir(): string
Get cache directory
|
#
|
public
|
setCacheDir(string $cache_dir): Smarty
Set cache directory
Parameters
$cache_dir |
directory to store cached templates in
|
Returns
current Smarty instance for chaining
|
#
|
public
|
createTemplate(
string $template,
mixed $cache_id = null,
mixed $compile_id = null,
object $parent = null,
boolean $do_clone = true,
): Smarty_Internal_Template
creates a template object
creates a template object
Parameters
$template |
the resource handle of the template file
|
$cache_id |
cache id to be used with this template
|
$compile_id |
compile id to be used with this template
|
$parent |
next higher level of Smarty variables
|
$do_clone |
flag is Smarty object shall be cloned
|
Returns
Throws
|
#
|
public
|
loadPlugin(string $plugin_name, bool $check = true): string|boolean
Takes unknown classes and loads plugin files for them
class name format: Smarty_PluginType_PluginName
plugin filename…
Takes unknown classes and loads plugin files for them
class name format: Smarty_PluginType_PluginName
plugin filename format: plugintype.pluginname.php
Parameters
$plugin_name |
class plugin name to load
|
$check |
check if already loaded
|
Returns
filepath of loaded file or false
Throws
|
#
|
public
|
_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
|
#
|
public
|
_realpath(string $path, bool $realpath = null): string
Normalize path
- remove /./ and /../
- make it absolute if required
Normalize path
- remove /./ and /../
- make it absolute if required
Parameters
$path |
file path
|
$realpath |
if true - convert to absolute
false - convert to relative
null - keep as it is but
remove /./ /../
|
|
#
|
public
|
_clearTemplateCache()
Empty template objects cache
Empty template objects cache
|
#
|
public
|
setUseSubDirs(boolean $use_sub_dirs)
|
#
|
public
|
setErrorReporting(int $error_reporting)
|
#
|
public
|
setEscapeHtml(boolean $escape_html)
|
#
|
public
|
getAutoLiteral(): boolean
Return auto_literal flag
|
#
|
public
|
setAutoLiteral(boolean $auto_literal = true)
Set auto_literal flag
|
#
|
public
|
setForceCompile(boolean $force_compile)
|
#
|
public
|
setMergeCompiledIncludes(boolean $merge_compiled_includes)
|
#
|
public
|
getLeftDelimiter(): string
Get left delimiter
|
#
|
public
|
setLeftDelimiter(string $left_delimiter)
Set left delimiter
|
#
|
public
|
getRightDelimiter(): string
Get right delimiter
|
#
|
public
|
setRightDelimiter($right_delimiter)
Set right delimiter
|
#
|
public
|
setDebugging(boolean $debugging)
|
#
|
public
|
setConfigOverwrite(boolean $config_overwrite)
|
#
|
public
|
setConfigBooleanize(boolean $config_booleanize)
|
#
|
public
|
setConfigReadHidden(boolean $config_read_hidden)
|
#
|
public
|
setCompileLocking(boolean $compile_locking)
|
#
|
public
|
setDefaultResourceType(string $default_resource_type)
|
#
|
public
|
setCachingType(string $caching_type)
|
#
|
public
|
testInstall(null &$errors = null)
Test install
|
#
|
public
|
_getSmartyObj(): Smarty
Get Smarty object
|
#
|
public
|
__get(string $name): mixed
<<magic>> Generic getter.
Calls the appropriate getter function.
Issues an E_USER_NOTICE if no valid getter is found.
<> Generic getter.
Calls the appropriate getter function.
Issues an E_USER_NOTICE if no valid getter is found.
Parameters
|
#
|
public
|
__set(string $name, mixed $value)
<<magic>> Generic setter.
Calls the appropriate setter function.
Issues an E_USER_NOTICE if no valid setter is found.
<> Generic setter.
Calls the appropriate setter function.
Issues an E_USER_NOTICE if no valid setter is found.
Parameters
$name |
property name
|
$value |
parameter passed to setter
|
|
#
|
public
|
clearAllCache(int $exp_time = null, string $type = null): int
|
#
|
public
|
clearCache(
string $template_name,
string $cache_id = null,
string $compile_id = null,
int $exp_time = null,
string $type = null,
): int
|
#
|
public
|
compileAllTemplates(
string $extension = "'.tpl'",
bool $force_compile = false,
int $time_limit = 0,
$max_errors = null,
): int
|
#
|
public
|
compileAllConfig(
string $extension = "'.conf'",
bool $force_compile = false,
int $time_limit = 0,
$max_errors = null,
): int
|
#
|
public
|
clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null): int
|
#
|
Properties |
public
static
|
|
$global_tpl_vars = []
assigned global tpl vars
|
#
|
public
static
|
|
$_MBSTRING = SMARTY_MBSTRING
Flag denoting if Multibyte String functions are available
Flag denoting if Multibyte String functions are available
|
#
|
public
static
|
|
$_CHARSET = SMARTY_RESOURCE_CHAR_SET
The character set to adhere to (e.g. "UTF-8")
The character set to adhere to (e.g. "UTF-8")
|
#
|
public
static
|
|
$_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT
The date format to be used internally
(accepts date() and strftime())
The date format to be used internally
(accepts date() and strftime())
|
#
|
public
static
|
|
$_UTF8_MODIFIER = 'u'
Flag denoting if PCRE should run in UTF-8 mode
Flag denoting if PCRE should run in UTF-8 mode
|
#
|
public
static
|
|
$_IS_WINDOWS = false
Flag denoting if operating system is windows
Flag denoting if operating system is windows
|
#
|
public
|
boolean
|
$auto_literal = true
|
#
|
public
|
boolean
|
$error_unassigned = false
|
#
|
public
|
boolean
|
$use_include_path = false
|
#
|
public
|
bool
|
$_templateDirNormalized = false
|
#
|
public
|
string
|
$_joined_template_dir = null
|
#
|
public
|
bool
|
$_configDirNormalized = false
|
#
|
public
|
string
|
$_joined_config_dir = null
|
#
|
public
|
callable
|
$default_template_handler_func = null
|
#
|
public
|
callable
|
$default_config_handler_func = null
|
#
|
public
|
callable
|
$default_plugin_handler_func = null
|
#
|
public
|
bool
|
$_compileDirNormalized = false
|
#
|
public
|
bool
|
$_pluginsDirNormalized = false
|
#
|
public
|
bool
|
$_cacheDirNormalized = false
|
#
|
public
|
boolean
|
$force_compile = false
|
#
|
public
|
boolean
|
$use_sub_dirs = false
|
#
|
public
|
boolean
|
$allow_ambiguous_resources = false
|
#
|
public
|
boolean
|
$merge_compiled_includes = false
|
#
|
public
|
|
$extends_recursion = true
|
#
|
public
|
boolean
|
$force_cache = false
|
#
|
public
|
string
|
$left_delimiter = "{"
|
#
|
public
|
string
|
$right_delimiter = "}"
|
#
|
public
|
array
|
$literals = []
string
|
#
|
public
|
string
|
$security_class = 'Smarty_Security'
|
#
|
public
|
Smarty_Security
|
$security_policy = null
|
#
|
public
|
integer
|
$php_handling = self::PHP_PASSTHRU
|
#
|
public
|
bool
|
$allow_php_templates = false
|
#
|
public
|
boolean
|
$debugging = false
|
#
|
public
|
string
|
$debugging_ctrl = 'NONE'
|
#
|
public
|
string
|
$smarty_debug_id = 'SMARTY_DEBUG'
|
#
|
public
|
string
|
$debug_tpl = null
|
#
|
public
|
int
|
$error_reporting = null
|
#
|
public
|
boolean
|
$config_overwrite = true
|
#
|
public
|
boolean
|
$config_booleanize = true
|
#
|
public
|
boolean
|
$config_read_hidden = false
|
#
|
public
|
boolean
|
$compile_locking = true
|
#
|
public
|
boolean
|
$cache_locking = false
|
#
|
public
|
float
|
$locking_timeout = 10
|
#
|
public
|
string
|
$default_resource_type = 'file'
|
#
|
public
|
string
|
$caching_type = 'file'
|
#
|
public
|
string
|
$default_config_type = 'file'
|
#
|
public
|
boolean
|
$cache_modified_check = false
|
#
|
public
|
array
|
$registered_plugins = []
|
#
|
public
|
array
|
$registered_objects = []
|
#
|
public
|
array
|
$registered_classes = []
|
#
|
public
|
array
|
$registered_filters = []
|
#
|
public
|
array
|
$registered_resources = []
|
#
|
public
|
array
|
$registered_cache_resources = []
|
#
|
public
|
array
|
$autoload_filters = []
|
#
|
public
|
array
|
$default_modifiers = []
|
#
|
public
|
boolean
|
$escape_html = false
|
#
|
public
|
int
|
$start_time = 0
|
#
|
public
|
string
|
$_current_file = null
|
#
|
public
|
bool
|
$_parserdebug = false
|
#
|
public
|
int
|
$_objType = 1
|
#
|
public
|
Smarty_Internal_Debug
|
$_debug = null
|
#
|
protected
|
array
|
$template_dir = ['./templates/']
|
#
|
protected
|
array
|
$_processedTemplateDir = []
|
#
|
protected
|
array
|
$config_dir = ['./configs/']
|
#
|
protected
|
array
|
$_processedConfigDir = []
|
#
|
protected
|
string
|
$compile_dir = './templates_c/'
|
#
|
protected
|
array
|
$plugins_dir = []
|
#
|
protected
|
string
|
$cache_dir = './cache/'
|
#
|
protected
|
string[]
|
$obsoleteProperties = [
'resource_caching',
'template_resource_caching',
'direct_access_security',
'_dir_perms',
'_file_perms',
'plugin_search_order',
'inheritance_merge_compiled_includes',
'resource_cache_mode',
]
|
#
|
protected
|
string[]
|
$accessMap = [
'template_dir' => 'TemplateDir',
'config_dir' => 'ConfigDir',
'plugins_dir' => 'PluginsDir',
'compile_dir' => 'CompileDir',
'cache_dir' => 'CacheDir',
]
|
#
|