Smarty Backward Compatability Wrapper Class

package Smarty
subpackage Template

 Methods

Handle unknown class methods

__call(string $name, array $args) 
Inherited
inherited_from \Smarty_Internal_TemplateBase::__call()
inherited_from \Smarty::__call()

Parameters

$name

string

unknown method-name

$args

array

argument array

<<magic>> set selfpointer on cloned object

__clone() 
Inherited
inherited_from \Smarty::__clone()

Initialize new SmartyBC object

__construct(array $options) 

Parameters

$options

array

options to set during initialization, e.g. array( 'forceCompile' => false )

Class destructor

__destruct() 
Inherited
inherited_from \Smarty::__destruct()

<<magic>> Generic getter.

__get(string $name) : mixed
Inherited

Calls the appropriate getter function. Issues an E_USER_NOTICE if no valid getter is found.

inherited_from \Smarty::__get()

Parameters

$name

string

property name

Returns

mixed

<<magic>> Generic setter.

__set(string $name, mixed $value) 
Inherited

Calls the appropriate setter function. Issues an E_USER_NOTICE if no valid setter is found.

inherited_from \Smarty::__set()

Parameters

$name

string

property name

$value

mixed

parameter passed to setter

Return internal filter name

_get_filter_name(callback $function_name) : string
Inherited
inherited_from \Smarty_Internal_TemplateBase::_get_filter_name()
inherited_from \Smarty::_get_filter_name()

Parameters

$function_name

callback

Returns

stringinternal filter name

Add autoload filters

addAutoloadFilters(array $filters, string $type) : \Smarty
Inherited
inherited_from \Smarty::addAutoloadFilters()

Parameters

$filters

array

filters to load automatically

$type

string

"pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types

Returns

\Smartycurrent Smarty instance for chaining

Add config directory(s)

addConfigDir(string | array $config_dir, string $key) : \Smarty
Inherited
inherited_from \Smarty::addConfigDir()

Parameters

$config_dir

stringarray

directory(s) of config sources

$key

string

key of the array element to assign the config dir to

Returns

\Smartycurrent Smarty instance for chaining

Add default modifiers

addDefaultModifiers(array | string $modifiers) : \Smarty
Inherited
inherited_from \Smarty::addDefaultModifiers()

Parameters

$modifiers

arraystring

modifier or list of modifiers to add

Returns

\Smartycurrent Smarty instance for chaining

Adds directory of plugin files

addPluginsDir($plugins_dir) : \Smarty
Inherited
inherited_from \Smarty::addPluginsDir()

Parameters

$plugins_dir

Returns

\Smartycurrent Smarty instance for chaining

Add template directory(s)

addTemplateDir(string | array $template_dir, string $key) : \Smarty
Inherited
inherited_from \Smarty::addTemplateDir()

Parameters

$template_dir

stringarray

directory(s) of template sources

$key

string

of the array element to assign the template dir to

Exceptions

\SmartyException when the given template directory is not valid

Returns

\Smartycurrent Smarty instance for chaining

appends values to template variables

append(array | string $tpl_var, mixed $value, boolean $merge, boolean $nocache) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::append()
inherited_from \Smarty_Internal_TemplateBase::append()
inherited_from \Smarty::append()

Parameters

$tpl_var

arraystring

the template variable name(s)

$value

mixed

the value to append

$merge

boolean

flag if array elements shall be merged

$nocache

boolean

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

appends values to template variables by reference

appendByRef(string $tpl_var, mixed $value, boolean $merge) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::appendByRef()
inherited_from \Smarty_Internal_TemplateBase::appendByRef()
inherited_from \Smarty::appendByRef()

Parameters

$tpl_var

string

the template variable name

$value

mixed

&$value the referenced value to append

$merge

boolean

flag if array elements shall be merged

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

wrapper for append_by_ref

append_by_ref(string $tpl_var, mixed $value, boolean $merge) 

Parameters

$tpl_var

string

the template variable name

$value

mixed

&$value the referenced value to append

$merge

boolean

flag if array elements shall be merged

assigns a Smarty variable

assign(array | string $tpl_var, mixed $value, boolean $nocache) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::assign()
inherited_from \Smarty_Internal_TemplateBase::assign()
inherited_from \Smarty::assign()

Parameters

$tpl_var

arraystring

the template variable name(s)

$value

mixed

the value to assign

$nocache

boolean

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

assigns values to template variables by reference

assignByRef(string $tpl_var, $value, boolean $nocache) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::assignByRef()
inherited_from \Smarty_Internal_TemplateBase::assignByRef()
inherited_from \Smarty::assignByRef()

Parameters

$tpl_var

string

the template variable name

$value

$nocache

boolean

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

assigns a global Smarty variable

assignGlobal(string $varname, mixed $value, boolean $nocache) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::assignGlobal()
inherited_from \Smarty_Internal_TemplateBase::assignGlobal()
inherited_from \Smarty::assignGlobal()

Parameters

$varname

string

the global variable name

$value

mixed

the value to assign

$nocache

boolean

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

wrapper for assign_by_ref

assign_by_ref(string $tpl_var, mixed $value) 

Parameters

$tpl_var

string

the template variable name

$value

mixed

&$value the referenced value to assign

clear all the assigned template variables.

clearAllAssign() : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::clearAllAssign()
inherited_from \Smarty_Internal_TemplateBase::clearAllAssign()
inherited_from \Smarty::clearAllAssign()

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

Empty cache folder

clearAllCache(integer $exp_time, string $type) : integer
Inherited
inherited_from \Smarty::clearAllCache()

Parameters

$exp_time

integer

expiration time

$type

string

resource type

Returns

integernumber of cache files deleted

clear the given assigned template variable.

clearAssign(string | array $tpl_var) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::clearAssign()
inherited_from \Smarty_Internal_TemplateBase::clearAssign()
inherited_from \Smarty::clearAssign()

Parameters

$tpl_var

stringarray

the template variable(s) to clear

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

Empty cache for a specific template

clearCache(string $template_name, string $cache_id, string $compile_id, integer $exp_time, string $type) : integer
Inherited
inherited_from \Smarty::clearCache()

Parameters

$template_name

string

template name

$cache_id

string

cache id

$compile_id

string

compile id

$exp_time

integer

expiration time

$type

string

resource type

Returns

integernumber of cache files deleted

Delete compiled template file

clearCompiledTemplate(string $resource_name, string $compile_id, integer $exp_time) : integer
Inherited
inherited_from \Smarty::clearCompiledTemplate()

Parameters

$resource_name

string

template name

$compile_id

string

compile id

$exp_time

integer

expiration time

Returns

integernumber of template files deleted

Deassigns a single or all config variables

clearConfig(string $varname) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::clearConfig()
inherited_from \Smarty_Internal_TemplateBase::clearConfig()
inherited_from \Smarty::clearConfig()

Parameters

$varname

string

variable name or null

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

clear all the assigned template variables.

clear_all_assign() 

clear the entire contents of cache (all templates)

clear_all_cache(string $exp_time) : boolean

Parameters

$exp_time

string

expire time

Returns

boolean

clear the given assigned template variable.

clear_assign(string $tpl_var) 

Parameters

$tpl_var

string

the template variable to clear

clear cached content for the given template and cache id

clear_cache(string $tpl_file, string $cache_id, string $compile_id, string $exp_time) : boolean

Parameters

$tpl_file

string

name of template file

$cache_id

string

name of cache_id

$compile_id

string

name of compile_id

$exp_time

string

expiration time

Returns

boolean

clears compiled version of specified template resource, or all compiled template files if one is not specified.

clear_compiled_tpl(string $tpl_file, string $compile_id, string $exp_time) : boolean

This function is for advanced use only, not normally needed.

Parameters

$tpl_file

string

$compile_id

string

$exp_time

string

Returns

booleanresults of {@link smarty_core_rm_auto()}

clear configuration values

clear_config(string $var) 

Parameters

$var

string

Compile all config files

compileAllConfig($extention, bool $force_compile, int $time_limit, int $max_errors) : integer
Inherited
inherited_from \Smarty::compileAllConfig()

Parameters

$extention

$force_compile

bool

force all to recompile

$time_limit

int

$max_errors

int

Returns

integernumber of template files recompiled

Compile all template files

compileAllTemplates($extention, bool $force_compile, int $time_limit, int $max_errors) : integer
Inherited
inherited_from \Smarty::compileAllTemplates()

Parameters

$extention

$force_compile

bool

force all to recompile

$time_limit

int

$max_errors

int

Returns

integernumber of template files recompiled

load a config file, optionally load just selected sections

configLoad(string $config_file, mixed $sections) : \Smarty_Internal_Data
Inherited
inherited_from \Smarty_Internal_Data::configLoad()
inherited_from \Smarty_Internal_TemplateBase::configLoad()
inherited_from \Smarty::configLoad()

Parameters

$config_file

string

filename

$sections

mixed

array of section names, single section or null

Returns

\Smarty_Internal_Datacurrent Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

load configuration values

config_load(string $file, string $section, string $scope) 

Parameters

$file

string

$section

string

$scope

string

creates a data object

createData(object $parent) 
Inherited
returns Smarty_Data data object
inherited_from \Smarty_Internal_TemplateBase::createData()
inherited_from \Smarty::createData()

Parameters

$parent

object

next higher level of Smarty variables

creates a template object

createTemplate(string $template, mixed $cache_id, mixed $compile_id, object $parent, boolean $do_clone) : object
Inherited
inherited_from \Smarty::createTemplate()

Parameters

$template

string

the resource handle of the template file

$cache_id

mixed

cache id to be used with this template

$compile_id

mixed

compile id to be used with this template

$parent

object

next higher level of Smarty variables

$do_clone

boolean

flag is Smarty object shall be cloned

Returns

objecttemplate object

Disable security

disableSecurity() : \Smarty
Inherited
inherited_from \Smarty::disableSecurity()

Returns

\Smartycurrent Smarty instance for chaining

displays a Smarty template

display(string $template, mixed $cache_id, mixed $compile_id, object $parent) 
Inherited
inherited_from \Smarty_Internal_TemplateBase::display()
inherited_from \Smarty::display()

Parameters

$template

string

the resource handle of the template file or template object

$cache_id

mixed

cache id to be used with this template

$compile_id

mixed

compile id to be used with this template

$parent

object

next higher level of Smarty variables

Loads security class and enables security

enableSecurity(string | \Smarty_Security $security_class) : \Smarty
Inherited
inherited_from \Smarty::enableSecurity()

Parameters

$security_class

string\Smarty_Security

if a string is used, it must be class-name

Exceptions

\SmartyException when an invalid class name is provided

Returns

\Smartycurrent Smarty instance for chaining

fetches a rendered Smarty template

fetch(string $template, mixed $cache_id, mixed $compile_id, object $parent, bool $display, bool $merge_tpl_vars, bool $no_output_filter) : string
Inherited
inherited_from \Smarty_Internal_TemplateBase::fetch()
inherited_from \Smarty::fetch()

Parameters

$template

string

the resource handle of the template file or template object

$cache_id

mixed

cache id to be used with this template

$compile_id

mixed

compile id to be used with this template

$parent

object

next higher level of Smarty variables

$display

bool

true: display, false: fetch

$merge_tpl_vars

bool

if true parent template variables merged in to local scope

$no_output_filter

bool

if true do not run output filter

Returns

stringrendered template output

Get autoload filters

getAutoloadFilters(string $type) : array
Inherited
inherited_from \Smarty::getAutoloadFilters()

Parameters

$type

string

type of filter to get autoloads for. Defaults to all autoload filters

Returns

arrayarray( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified

Get cache directory

getCacheDir() : string
Inherited
inherited_from \Smarty::getCacheDir()

Returns

stringpath of cache directory

Get compiled directory

getCompileDir() : string
Inherited
inherited_from \Smarty::getCompileDir()

Returns

stringpath to compiled templates

Get config directory

getConfigDir(mixed $index) : array | string
Inherited
inherited_from \Smarty::getConfigDir()

Parameters

$index

mixed

index of directory to get, null to get all

Returns

arraystringconfiguration directory

gets a config variable

getConfigVariable(string $variable, $error_enable) : mixed
Inherited
inherited_from \Smarty_Internal_Data::getConfigVariable()
inherited_from \Smarty_Internal_TemplateBase::getConfigVariable()
inherited_from \Smarty::getConfigVariable()

Parameters

$variable

string

the name of the config variable

$error_enable

Returns

mixedthe value of the config variable

Returns a single or all config variables

getConfigVars(string $varname, $search_parents) : string
Inherited
inherited_from \Smarty_Internal_Data::getConfigVars()
inherited_from \Smarty_Internal_TemplateBase::getConfigVars()
inherited_from \Smarty::getConfigVars()

Parameters

$varname

string

variable name or null

$search_parents

Returns

stringvariable value or or array of variables

return name of debugging template

getDebugTemplate() : string
Inherited
inherited_from \Smarty::getDebugTemplate()

Returns

string

Get default modifiers

getDefaultModifiers() : array
Inherited
inherited_from \Smarty::getDefaultModifiers()

Returns

arraylist of default modifiers

Returns a single or all global variables

getGlobal(string $varname) : string
Inherited
inherited_from \Smarty::getGlobal()

Parameters

$varname

string

variable name or null

Returns

stringvariable value or or array of variables

Get plugin directories

getPluginsDir() : array
Inherited
inherited_from \Smarty::getPluginsDir()

Returns

arraylist of plugin directories

return a reference to a registered object

getRegisteredObject(string $name) : object
Inherited
inherited_from \Smarty_Internal_TemplateBase::getRegisteredObject()
inherited_from \Smarty::getRegisteredObject()

Parameters

$name

string

object name

Exceptions

\SmartyException if no such object is found

Returns

object

gets a stream variable

getStreamVariable(string $variable) : mixed
Inherited
inherited_from \Smarty_Internal_Data::getStreamVariable()
inherited_from \Smarty_Internal_TemplateBase::getStreamVariable()
inherited_from \Smarty::getStreamVariable()

Parameters

$variable

string

the stream of the variable

Returns

mixedthe value of the stream variable

Return array of tag/attributes of all tags used by an template

getTags(\Smarty_Internal_Template $template) : array
Inherited
inherited_from \Smarty::getTags()

Parameters

$template

Returns

arrayof tag/attributes

Get template directories

getTemplateDir(mixed $index) : array | string
Inherited
inherited_from \Smarty::getTemplateDir()

Parameters

$index

mixed

index of directory to get, null to get all

Returns

arraystringlist of template directories, or directory of $index

Returns a single or all template variables

getTemplateVars(string $varname, string $_ptr, boolean $search_parents) : string
Inherited
inherited_from \Smarty_Internal_Data::getTemplateVars()
inherited_from \Smarty_Internal_TemplateBase::getTemplateVars()
inherited_from \Smarty::getTemplateVars()

Parameters

$varname

string

variable name or null

$_ptr

string

optional pointer to data object

$search_parents

boolean

include parent templates?

Returns

stringvariable value or or array of variables

gets the object of a Smarty variable

getVariable(string $variable, object $_ptr, boolean $search_parents, $error_enable) : object
Inherited
inherited_from \Smarty_Internal_Data::getVariable()
inherited_from \Smarty_Internal_TemplateBase::getVariable()
inherited_from \Smarty::getVariable()

Parameters

$variable

string

the name of the Smarty variable

$_ptr

object

optional pointer to data object

$search_parents

boolean

search also in parent data

$error_enable

Returns

objectthe object of the variable

Returns an array containing config variables

get_config_vars(string $name) : array

Parameters

$name

string

Returns

array

return a reference to a registered object

get_registered_object(string $name) : object

Parameters

$name

string

Returns

object

Returns an array containing template variables

get_template_vars(string $name) : array

Parameters

$name

string

Returns

array

test if cache is valid

isCached(string | object $template, mixed $cache_id, mixed $compile_id, object $parent) : boolean
Inherited
inherited_from \Smarty_Internal_TemplateBase::isCached()
inherited_from \Smarty::isCached()

Parameters

$template

stringobject

the resource handle of the template file or template object

$cache_id

mixed

cache id to be used with this template

$compile_id

mixed

compile id to be used with this template

$parent

object

next higher level of Smarty variables

Returns

booleancache status

test to see if valid cache exists for this template

is_cached(string $tpl_file, string $cache_id, string $compile_id) : boolean

Parameters

$tpl_file

string

name of template file

$cache_id

string

$compile_id

string

Returns

boolean

load a filter of specified type and name

loadFilter(string $type, string $name) 
Inherited
inherited_from \Smarty_Internal_TemplateBase::loadFilter()
inherited_from \Smarty::loadFilter()

Parameters

$type

string

filter type

$name

string

filter name

Exceptions

\SmartyException if filter could not be loaded

Takes unknown classes and loads plugin files for them class name format: Smarty_PluginType_PluginName plugin filename format: plugintype.pluginname.php

loadPlugin(string $plugin_name, bool $check) : string
Inherited
inherited_from \Smarty::loadPlugin()

Parameters

$plugin_name

string

class plugin name to load

$check

bool

check if already loaded

Returns

string|boolean filepath of loaded file or false

load a filter of specified type and name

load_filter(string $type, string $name) 

Parameters

$type

string

filter type

$name

string

filter name

Enable error handler to mute expected messages

muteExpectedErrors() : void
InheritedStatic
inherited_from \Smarty::muteExpectedErrors()

Error Handler to mute expected messages

mutingErrorHandler(integer $errno, $errstr, $errfile, $errline, $errcontext) : boolean
InheritedStatic
link http://php.net/set_error_handler
inherited_from \Smarty::mutingErrorHandler()

Parameters

$errno

integer

Error level

$errstr

$errfile

$errline

$errcontext

Returns

boolean

Registers a cache resource to cache a template's output

registerCacheResource(string $type, \Smarty_CacheResource $callback) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerCacheResource()
inherited_from \Smarty::registerCacheResource()

Parameters

$type

string

name of cache resource type

$callback

\Smarty_CacheResource

instance of Smarty_CacheResource to handle output caching

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers static classes to be used in templates

registerClass($class_name, string $class_impl) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerClass()
inherited_from \Smarty::registerClass()

Parameters

$class_name

$class_impl

string

the referenced PHP class to register

Exceptions

\SmartyException if $class_impl does not refer to an existing class

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a default template handler

registerDefaultConfigHandler(callable $callback) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerDefaultConfigHandler()
inherited_from \Smarty::registerDefaultConfigHandler()

Parameters

$callback

callable

class/method name

Exceptions

\SmartyException if $callback is not callable

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a default plugin handler

registerDefaultPluginHandler(callable $callback) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerDefaultPluginHandler()
inherited_from \Smarty::registerDefaultPluginHandler()

Parameters

$callback

callable

class/method name

Exceptions

\SmartyException if $callback is not callable

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a default template handler

registerDefaultTemplateHandler(callable $callback) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerDefaultTemplateHandler()
inherited_from \Smarty::registerDefaultTemplateHandler()

Parameters

$callback

callable

class/method name

Exceptions

\SmartyException if $callback is not callable

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a filter function

registerFilter(string $type, callback $callback) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerFilter()
inherited_from \Smarty::registerFilter()

Parameters

$type

string

filter type

$callback

callback

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers object to be used in templates

registerObject($object_name, object $object_impl, array $allowed, boolean $smarty_args, array $block_methods) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerObject()
inherited_from \Smarty::registerObject()

Parameters

$object_name

$object_impl

object

the referenced PHP object to register

$allowed

array

list of allowed methods (empty = all)

$smarty_args

boolean

smarty argument format, else traditional

$block_methods

array

list of block-methods

Exceptions

\SmartyException if any of the methods in $allowed or $block_methods are invalid

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers plugin to be used in templates

registerPlugin(string $type, string $tag, callback $callback, boolean $cacheable, array $cache_attr) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerPlugin()
inherited_from \Smarty::registerPlugin()

Parameters

$type

string

plugin type

$tag

string

name of template tag

$callback

callback

PHP callback to register

$cacheable

boolean

if true (default) this fuction is cachable

$cache_attr

array

caching attributes if any

Exceptions

\SmartyException when the plugin tag is invalid

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers a resource to fetch a template

registerResource(string $type, \Smarty_Resource | array $callback) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::registerResource()
inherited_from \Smarty::registerResource()

Parameters

$type

string

name of resource type

$callback

\Smarty_Resourcearray

or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated)

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Registers block function to be used in templates

register_block(string $block, string $block_impl, bool $cacheable, mixed $cache_attrs) 

Parameters

$block

string

name of template block

$block_impl

string

PHP function to register

$cacheable

bool

$cache_attrs

mixed

Registers compiler function

register_compiler_function(string $function, string $function_impl, bool $cacheable) 

Parameters

$function

string

name of template function

$function_impl

string

name of PHP function to register

$cacheable

bool

Registers custom function to be used in templates

register_function(string $function, string $function_impl, bool $cacheable, mixed $cache_attrs) 

Parameters

$function

string

the name of the template function

$function_impl

string

the name of the PHP function to register

$cacheable

bool

$cache_attrs

mixed

Registers modifier to be used in templates

register_modifier(string $modifier, string $modifier_impl) 

Parameters

$modifier

string

name of template modifier

$modifier_impl

string

name of PHP function to register

Registers object to be used in templates

register_object(string $object, object $object_impl, array $allowed, boolean $smarty_args, $block_methods) 

Parameters

$object

string

name of template object

$object_impl

object

the referenced PHP object to register

$allowed

array

list of allowed methods (empty = all)

$smarty_args

boolean

smarty argument format, else traditional

$block_methods

Registers an output filter function to apply to a template output

register_outputfilter(callable $function) 

Parameters

$function

callable

Registers a postfilter function to apply to a compiled template after compilation

register_postfilter(callable $function) 

Parameters

$function

callable

Registers a prefilter function to apply to a template before compiling

register_prefilter(callable $function) 

Parameters

$function

callable

Registers a resource to fetch a template

register_resource(string $type, array $functions) 

Parameters

$type

string

name of resource

$functions

array

array of functions to handle resource

Set autoload filters

setAutoloadFilters(array $filters, string $type) : \Smarty
Inherited
inherited_from \Smarty::setAutoloadFilters()

Parameters

$filters

array

filters to load automatically

$type

string

"pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types

Returns

\Smartycurrent Smarty instance for chaining

Set cache directory

setCacheDir(string $cache_dir) : \Smarty
Inherited
inherited_from \Smarty::setCacheDir()

Parameters

$cache_dir

string

directory to store cached templates in

Returns

\Smartycurrent Smarty instance for chaining

Set compile directory

setCompileDir(string $compile_dir) : \Smarty
Inherited
inherited_from \Smarty::setCompileDir()

Parameters

$compile_dir

string

directory to store compiled templates in

Returns

\Smartycurrent Smarty instance for chaining

Set config directory

setConfigDir($config_dir) : \Smarty
Inherited
inherited_from \Smarty::setConfigDir()

Parameters

$config_dir

Returns

\Smartycurrent Smarty instance for chaining

set the debug template

setDebugTemplate(string $tpl_name) : \Smarty
Inherited
inherited_from \Smarty::setDebugTemplate()

Parameters

$tpl_name

string

Exceptions

\SmartyException if file is not readable

Returns

\Smartycurrent Smarty instance for chaining

Set default modifiers

setDefaultModifiers(array | string $modifiers) : \Smarty
Inherited
inherited_from \Smarty::setDefaultModifiers()

Parameters

$modifiers

arraystring

modifier or list of modifiers to set

Returns

\Smartycurrent Smarty instance for chaining

Set plugins directory

setPluginsDir(string | array $plugins_dir) : \Smarty
Inherited
inherited_from \Smarty::setPluginsDir()

Parameters

$plugins_dir

stringarray

directory(s) of plugins

Returns

\Smartycurrent Smarty instance for chaining

Set template directory

setTemplateDir(string | array $template_dir) : \Smarty
Inherited
inherited_from \Smarty::setTemplateDir()

Parameters

$template_dir

stringarray

directory(s) of template sources

Returns

\Smartycurrent Smarty instance for chaining

Check if a template resource exists

templateExists(string $resource_name) : boolean
Inherited
inherited_from \Smarty::templateExists()

Parameters

$resource_name

string

template name

Returns

booleanstatus

Checks whether requested template exists.

template_exists(string $tpl_file) : boolean

Parameters

$tpl_file

string

Returns

boolean

Run installation test

testInstall(array $errors) : boolean
Inherited
inherited_from \Smarty::testInstall()

Parameters

$errors

array

Array to write errors into, rather than outputting them

Returns

booleantrue if setup is fine, false if something is wrong

trigger Smarty error

trigger_error(string $error_msg, integer $error_type) 

Parameters

$error_msg

string

$error_type

integer

unload a filter of specified type and name

unloadFilter(string $type, string $name) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::unloadFilter()
inherited_from \Smarty::unloadFilter()

Parameters

$type

string

filter type

$name

string

filter name

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Disable error handler muting expected messages

unmuteExpectedErrors() : void
InheritedStatic
inherited_from \Smarty::unmuteExpectedErrors()

Unregisters a cache resource

unregisterCacheResource(string $type) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::unregisterCacheResource()
inherited_from \Smarty::unregisterCacheResource()

Parameters

$type

string

name of cache resource type

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Unregisters a filter function

unregisterFilter(string $type, callback $callback) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::unregisterFilter()
inherited_from \Smarty::unregisterFilter()

Parameters

$type

string

filter type

$callback

callback

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

unregister an object

unregisterObject(string $name) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::unregisterObject()
inherited_from \Smarty::unregisterObject()

Parameters

$name

string

object name

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Unregister Plugin

unregisterPlugin(string $type, string $tag) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::unregisterPlugin()
inherited_from \Smarty::unregisterPlugin()

Parameters

$type

string

of plugin

$tag

string

name of plugin

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Unregisters a resource

unregisterResource(string $type) : \Smarty_Internal_Templatebase
Inherited
inherited_from \Smarty_Internal_TemplateBase::unregisterResource()
inherited_from \Smarty::unregisterResource()

Parameters

$type

string

name of resource type

Returns

\Smarty_Internal_Templatebasecurrent Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining

Unregisters block function

unregister_block(string $block) 

Parameters

$block

string

name of template function

Unregisters compiler function

unregister_compiler_function(string $function) 

Parameters

$function

string

name of template function

Unregisters custom function

unregister_function(string $function) 

Parameters

$function

string

name of template function

Unregisters modifier

unregister_modifier(string $modifier) 

Parameters

$modifier

string

name of template modifier

Unregisters object

unregister_object(string $object) 

Parameters

$object

string

name of template object

Unregisters an outputfilter function

unregister_outputfilter(callable $function) 

Parameters

$function

callable

Unregisters a postfilter function

unregister_postfilter(callable $function) 

Parameters

$function

callable

Unregisters a prefilter function

unregister_prefilter(callable $function) 

Parameters

$function

callable

Unregisters a resource

unregister_resource(string $type) 

Parameters

$type

string

name of resource

preg_replace callback to convert camelcase getter/setter to underscore property names

replaceCamelcase(string $match) : string
Inherited
inherited_from \Smarty_Internal_TemplateBase::replaceCamelcase()
inherited_from \Smarty::replaceCamelcase()

Parameters

$match

string

match string

Returns

stringreplacemant

 Properties

 

$_CHARSET 
Inherited

"UTF-8")

inherited_from \Smarty::$$_CHARSET
 

$_DATE_FORMAT 
Inherited
inherited_from \Smarty::$$_DATE_FORMAT
 

$_IS_WINDOWS 
Inherited
inherited_from \Smarty::$$_IS_WINDOWS
 

$_MBSTRING 
Inherited
inherited_from \Smarty::$$_MBSTRING
 

$_UTF8_MODIFIER 
Inherited
inherited_from \Smarty::$$_UTF8_MODIFIER
 

$_cacheresource_handlers : array
Inherited
inherited_from \Smarty::$$_cacheresource_handlers
 

$_current_file : string
Inherited
inherited_from \Smarty::$$_current_file
 

$_dir_perms : int
Inherited
inherited_from \Smarty::$$_dir_perms
 

$_file_perms : int
Inherited
inherited_from \Smarty::$$_file_perms
 

$_muted_directories 
Inherited
inherited_from \Smarty::$$_muted_directories
 

$_parserdebug : bool
Inherited
inherited_from \Smarty::$$_parserdebug
 

$_previous_error_handler 
Inherited
inherited_from \Smarty::$$_previous_error_handler
 

$_resource_handlers : array
Inherited
inherited_from \Smarty::$$_resource_handlers
 

$_smarty_vars : array
Inherited
inherited_from \Smarty::$$_smarty_vars
 

$_tag_stack : array
Inherited
inherited_from \Smarty::$$_tag_stack
 

$_version : string
 

$allow_ambiguous_resources : boolean
Inherited
inherited_from \Smarty::$$allow_ambiguous_resources
 

$allow_php_templates : bool
Inherited
inherited_from \Smarty::$$allow_php_templates
 

$auto_literal : boolean
Inherited
inherited_from \Smarty::$$auto_literal
 

$autoload_filters : array
Inherited
inherited_from \Smarty::$$autoload_filters
 

$cache_id : string
Inherited
inherited_from \Smarty::$$cache_id
 

$cache_lifetime : integer
Inherited
inherited_from \Smarty::$$cache_lifetime
 

$cache_locking : boolean
Inherited
inherited_from \Smarty::$$cache_locking
 

$cache_modified_check : boolean
Inherited
inherited_from \Smarty::$$cache_modified_check
 

$caching : boolean
Inherited
inherited_from \Smarty::$$caching
 

$caching_type : string
Inherited

Must be an element of $cache_resource_types.

inherited_from \Smarty::$$caching_type
 

$compile_check : boolean
Inherited
inherited_from \Smarty::$$compile_check
 

$compile_id : string
Inherited
inherited_from \Smarty::$$compile_id
 

$compile_locking : boolean
Inherited
inherited_from \Smarty::$$compile_locking
 

$config_booleanize : boolean
Inherited
inherited_from \Smarty::$$config_booleanize
 

$config_overwrite : boolean
Inherited
inherited_from \Smarty::$$config_overwrite
 

$config_read_hidden : boolean
Inherited
inherited_from \Smarty::$$config_read_hidden
 

$config_vars : array
Inherited
inherited_from \Smarty_Internal_Data::$$config_vars
inherited_from \Smarty_Internal_TemplateBase::$$config_vars
inherited_from \Smarty::$$config_vars
 

$debug_tpl : string
Inherited
inherited_from \Smarty::$$debug_tpl
 

$debugging : boolean
Inherited

Setting this to true enables the debug-console.

inherited_from \Smarty::$$debugging
 

$debugging_ctrl : string
Inherited
  • NONE => no debugging control allowed
  • URL => enable debugging when SMARTY_DEBUG is found in the URL.
inherited_from \Smarty::$$debugging_ctrl
 

$default_config_handler_func : callable
Inherited
inherited_from \Smarty::$$default_config_handler_func
 

$default_config_type : string
Inherited
inherited_from \Smarty::$$default_config_type
 

$default_modifiers : array
Inherited
inherited_from \Smarty::$$default_modifiers
 

$default_plugin_handler_func : callable
Inherited
inherited_from \Smarty::$$default_plugin_handler_func
 

$default_resource_type : string
Inherited

Must be an valid key of $registered_resources.

inherited_from \Smarty::$$default_resource_type
 

$default_template_handler_func : callable
Inherited
inherited_from \Smarty::$$default_template_handler_func
 

$direct_access_security : boolean
Inherited

{@internal Currently used by Smarty_Internal_Template only. }}

inherited_from \Smarty::$$direct_access_security
 

$error_reporting : int
Inherited
inherited_from \Smarty::$$error_reporting
 

$error_unassigned : boolean
Inherited
inherited_from \Smarty::$$error_unassigned
 

$escape_html : boolean
Inherited
inherited_from \Smarty::$$escape_html
 

$force_cache : boolean
Inherited
inherited_from \Smarty::$$force_cache
 

$force_compile : boolean
Inherited
inherited_from \Smarty::$$force_compile
 

$get_used_tags : boolean
Inherited
inherited_from \Smarty::$$get_used_tags
 

$global_tpl_vars 
Inherited
inherited_from \Smarty::$$global_tpl_vars
 

$joined_config_dir : string
Inherited
inherited_from \Smarty::$$joined_config_dir
 

$joined_template_dir : string
Inherited
inherited_from \Smarty::$$joined_template_dir
 

$left_delimiter : string
Inherited
inherited_from \Smarty::$$left_delimiter
 

$locking_timeout : float
Inherited
inherited_from \Smarty::$$locking_timeout
 

$merge_compiled_includes : boolean
Inherited
inherited_from \Smarty::$$merge_compiled_includes
 

$merged_templates_func : array
Inherited
inherited_from \Smarty::$$merged_templates_func
 

$parent : \Smarty_Internal_Template
Inherited
inherited_from \Smarty_Internal_Data::$$parent
inherited_from \Smarty_Internal_TemplateBase::$$parent
inherited_from \Smarty::$$parent
 

$php_handling : integer
Inherited
inherited_from \Smarty::$$php_handling
 

$plugin_search_order : array
Inherited
inherited_from \Smarty::$$plugin_search_order
 

$properties : array
Inherited
inherited_from \Smarty::$$properties
 

$registered_cache_resources : array
Inherited
inherited_from \Smarty::$$registered_cache_resources
 

$registered_classes : array
Inherited
inherited_from \Smarty::$$registered_classes
 

$registered_filters : array
Inherited
inherited_from \Smarty::$$registered_filters
 

$registered_objects : array
Inherited
inherited_from \Smarty::$$registered_objects
 

$registered_plugins : array
Inherited
inherited_from \Smarty::$$registered_plugins
 

$registered_resources : array
Inherited
inherited_from \Smarty::$$registered_resources
 

$right_delimiter : string
Inherited
inherited_from \Smarty::$$right_delimiter
 

$security_class : string
Inherited

This should be instance of Smarty_Security.

see \Smarty_Security
inherited_from \Smarty::$$security_class
 

$security_policy : \Smarty_Security
Inherited
inherited_from \Smarty::$$security_policy
 

$smarty : \Smarty
Inherited
inherited_from \Smarty::$$smarty
 

$smarty_debug_id : \type
Inherited

Only used when $debugging_ctrl is set to 'URL'. The name of the URL-parameter that activates debugging.

inherited_from \Smarty::$$smarty_debug_id
 

$start_time : int
Inherited
inherited_from \Smarty::$$start_time
 

$template_class : string
Inherited
inherited_from \Smarty_Internal_Data::$$template_class
inherited_from \Smarty_Internal_TemplateBase::$$template_class
inherited_from \Smarty::$$template_class
 

$template_functions : array
Inherited
inherited_from \Smarty::$$template_functions
 

$template_objects : array
Inherited
inherited_from \Smarty::$$template_objects
 

$tpl_vars : array
Inherited
inherited_from \Smarty_Internal_Data::$$tpl_vars
inherited_from \Smarty_Internal_TemplateBase::$$tpl_vars
inherited_from \Smarty::$$tpl_vars
 

$use_include_path : boolean
Inherited
inherited_from \Smarty::$$use_include_path
 

$use_sub_dirs : boolean
Inherited
inherited_from \Smarty::$$use_sub_dirs
 

$cache_dir : string
Inherited
inherited_from \Smarty::$$cache_dir
 

$compile_dir : string
Inherited
inherited_from \Smarty::$$compile_dir
 

$config_dir : array
Inherited
inherited_from \Smarty::$$config_dir
 

$plugins_dir : array
Inherited
inherited_from \Smarty::$$plugins_dir
 

$template_dir : array
Inherited
inherited_from \Smarty::$$template_dir

 Constants

 

CACHING_LIFETIME_CURRENT

CACHING_LIFETIME_CURRENT 
Inherited
inherited_from \Smarty::CACHING_LIFETIME_CURRENT
 

CACHING_LIFETIME_SAVED

CACHING_LIFETIME_SAVED 
Inherited
inherited_from \Smarty::CACHING_LIFETIME_SAVED
 

define caching modes

CACHING_OFF 
Inherited
inherited_from \Smarty::CACHING_OFF
 

COMPILECHECK_CACHEMISS

COMPILECHECK_CACHEMISS 
Inherited
inherited_from \Smarty::COMPILECHECK_CACHEMISS
 

define compile check modes

COMPILECHECK_OFF 
Inherited
inherited_from \Smarty::COMPILECHECK_OFF
 

COMPILECHECK_ON

COMPILECHECK_ON 
Inherited
inherited_from \Smarty::COMPILECHECK_ON
 

FILTER_OUTPUT

FILTER_OUTPUT 
Inherited
inherited_from \Smarty::FILTER_OUTPUT
 

filter types

FILTER_POST 
Inherited
inherited_from \Smarty::FILTER_POST
 

FILTER_PRE

FILTER_PRE 
Inherited
inherited_from \Smarty::FILTER_PRE
 

FILTER_VARIABLE

FILTER_VARIABLE 
Inherited
inherited_from \Smarty::FILTER_VARIABLE
 

PHP_ALLOW

PHP_ALLOW 
Inherited
inherited_from \Smarty::PHP_ALLOW
 

modes for handling of "<?php .

PHP_PASSTHRU 
Inherited

.. ?>" tags in templates.

inherited_from \Smarty::PHP_PASSTHRU
 

PHP_QUOTE

PHP_QUOTE 
Inherited
inherited_from \Smarty::PHP_QUOTE
 

PHP_REMOVE

PHP_REMOVE 
Inherited
inherited_from \Smarty::PHP_REMOVE
 

PLUGIN_BLOCK

PLUGIN_BLOCK 
Inherited
inherited_from \Smarty::PLUGIN_BLOCK
 

PLUGIN_COMPILER

PLUGIN_COMPILER 
Inherited
inherited_from \Smarty::PLUGIN_COMPILER
 

plugin types

PLUGIN_FUNCTION 
Inherited
inherited_from \Smarty::PLUGIN_FUNCTION
 

PLUGIN_MODIFIER

PLUGIN_MODIFIER 
Inherited
inherited_from \Smarty::PLUGIN_MODIFIER
 

PLUGIN_MODIFIERCOMPILER

PLUGIN_MODIFIERCOMPILER 
Inherited
inherited_from \Smarty::PLUGIN_MODIFIERCOMPILER
 

SCOPE_GLOBAL

SCOPE_GLOBAL 
Inherited
inherited_from \Smarty::SCOPE_GLOBAL
 

define variable scopes

SCOPE_LOCAL 
Inherited
inherited_from \Smarty::SCOPE_LOCAL
 

SCOPE_PARENT

SCOPE_PARENT 
Inherited
inherited_from \Smarty::SCOPE_PARENT
 

SCOPE_ROOT

SCOPE_ROOT 
Inherited
inherited_from \Smarty::SCOPE_ROOT
 

smarty version

SMARTY_VERSION 
Inherited
inherited_from \Smarty::SMARTY_VERSION