Properties

$_objType

$_objType : integer

This object type (Smarty = 1, template = 2, data = 4)

Type

integer

$template_class

$template_class : string

name of class used for templates

Type

string

$tpl_vars

$tpl_vars : array<mixed,\Smarty_Variable>

template variables

Type

array<mixed,\Smarty_Variable>

$config_vars

$config_vars : array<mixed,string>

configuration settings

Type

array<mixed,string>

$cache_id

$cache_id : string

Set this if you want different sets of cache files for the same templates.

Type

string

$compile_id

$compile_id : string

Set this if you want different sets of compiled files for the same templates.

Type

string

$caching

$caching : boolean

caching enabled

Type

boolean

$cache_lifetime

$cache_lifetime : integer

cache lifetime in seconds

Type

integer

$tplFunctions

$tplFunctions : array

Array of source information for known template functions

Type

array

$_cache

$_cache : \array()

universal cache

Type

\array()

$_objType

$_objType : integer

This object type (Smarty = 1, template = 2, data = 4)

The following methods will be dynamically loaded by the extension handler when they are called. They are located in a corresponding Smarty_Internal_Method_xxxx class

Type

integer

$scope

$scope : integer

Type

integer

$smarty

$smarty : \Smarty

The following methods will be dynamically loaded by the extension handler when they are called. They are located in a corresponding Smarty_Internal_Method_xxxx class

Type

\Smarty

Methods

__construct()

__construct() 

Smarty_Internal_Data constructor.

Install extension handler

assign()

assign(array|string  $tpl_var, mixed  $value = null, boolean  $nocache = false) : \Smarty_Internal_Data

assigns a Smarty variable

Parameters

array|string $tpl_var

the template variable name(s)

mixed $value

the value to assign

boolean $nocache

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Data

current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

append()

append(array|string  $tpl_var, mixed  $value = null, boolean  $merge = false, boolean  $nocache = false) : \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty

appends values to template variables

Parameters

array|string $tpl_var

the template variable name(s)

mixed $value

the value to append

boolean $merge

flag if array elements shall be merged

boolean $nocache

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty

assignGlobal()

assignGlobal(string  $varName, mixed  $value = null, boolean  $nocache = false) : \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty

assigns a global Smarty variable

Parameters

string $varName

the global variable name

mixed $value

the value to assign

boolean $nocache

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty

appendByRef()

appendByRef(string  $tpl_var,   $value, boolean  $merge = false) : \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty

appends values to template variables by reference

Parameters

string $tpl_var

the template variable name

$value
boolean $merge

flag if array elements shall be merged

Returns

\Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty

assignByRef()

assignByRef(string  $tpl_var,   $value, boolean  $nocache = false) : \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty

assigns values to template variables by reference

Parameters

string $tpl_var

the template variable name

$value
boolean $nocache

if true any output of this variable will be not cached

Returns

\Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty

getTemplateVars()

getTemplateVars(string  $varName = null, \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty  $_ptr = null, boolean  $searchParents = true) : mixed

Returns a single or all template variables

Parameters

string $varName

variable name or null

\Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr

optional pointer to data object

boolean $searchParents

include parent templates?

Returns

mixed —

variable value or or array of variables

getVariable()

getVariable(string  $variable = null, \Smarty_Internal_Data  $_ptr = null, boolean  $searchParents = true, boolean  $error_enable = true) : \Smarty_Variable|\Smarty_Undefined_Variable

gets the object of a Smarty variable

Parameters

string $variable

the name of the Smarty variable

\Smarty_Internal_Data $_ptr

optional pointer to data object

boolean $searchParents

search also in parent data

boolean $error_enable

Returns

\Smarty_Variable|\Smarty_Undefined_Variable

the object of the variable

_mergeVars()

_mergeVars(\Smarty_Internal_Data|null  $data = null) 

Follow the parent chain an merge template and config variables

Parameters

\Smarty_Internal_Data|null $data

_isDataObj()

_isDataObj() : boolean

Return true if this instance is a Data obj

Returns

boolean

_isTplObj()

_isTplObj() : boolean

Return true if this instance is a template obj

Returns

boolean

_isSmartyObj()

_isSmartyObj() : boolean

Return true if this instance is a Smarty obj

Returns

boolean

_getSmartyObj()

_getSmartyObj() : \Smarty

Get Smarty object

Returns

\Smarty

__call()

__call(string  $name, array  $args) : mixed

Handle unknown class methods

Parameters

string $name

unknown method-name

array $args

argument array

Throws

\SmartyException

Returns

mixed

fetch()

fetch(string  $template = null, mixed  $cache_id = null, mixed  $compile_id = null, object  $parent = null) : string

fetches a rendered Smarty template

Parameters

string $template

the resource handle of the template file or template object

mixed $cache_id

cache id to be used with this template

mixed $compile_id

compile id to be used with this template

object $parent

next higher level of Smarty variables

Throws

\Exception
\SmartyException

Returns

string —

rendered template output

display()

display(string  $template = null, mixed  $cache_id = null, mixed  $compile_id = null, object  $parent = null) 

displays a Smarty template

Parameters

string $template

the resource handle of the template file or template object

mixed $cache_id

cache id to be used with this template

mixed $compile_id

compile id to be used with this template

object $parent

next higher level of Smarty variables

isCached()

isCached(null|string|\Smarty_Internal_Template  $template = null, mixed  $cache_id = null, mixed  $compile_id = null, object  $parent = null) : boolean

test if cache is valid

Parameters

null|string|\Smarty_Internal_Template $template

the resource handle of the template file or template object

mixed $cache_id

cache id to be used with this template

mixed $compile_id

compile id to be used with this template

object $parent

next higher level of Smarty variables

Returns

boolean —

cache status

registerPlugin()

registerPlugin(string  $type, string  $name, callback  $callback, boolean  $cacheable = true, mixed  $cache_attr = null) : \Smarty|\Smarty_Internal_Template

Registers plugin to be used in templates

Parameters

string $type

plugin type

string $name

name of template tag

callback $callback

PHP callback to register

boolean $cacheable

if true (default) this function is cache able

mixed $cache_attr

caching attributes if any

Throws

\SmartyException

when the plugin tag is invalid

Returns

\Smarty|\Smarty_Internal_Template

loadFilter()

loadFilter(string  $type, string  $name) : boolean

load a filter of specified type and name

Parameters

string $type

filter type

string $name

filter name

Throws

\SmartyException

if filter could not be loaded

Returns

boolean

registerFilter()

registerFilter(string  $type, callback  $callback, string|null  $name = null) : \Smarty|\Smarty_Internal_Template

Registers a filter function

Parameters

string $type

filter type

callback $callback
string|null $name

optional filter name

Throws

\SmartyException

Returns

\Smarty|\Smarty_Internal_Template

registerObject()

registerObject(string  $object_name, object  $object, array  $allowed_methods_properties = array(), boolean  $format = true, array  $block_methods = array()) : \Smarty|\Smarty_Internal_Template

Registers object to be used in templates

Parameters

string $object_name
object $object

the referenced PHP object to register

array $allowed_methods_properties

list of allowed methods (empty = all)

boolean $format

smarty argument format, else traditional

array $block_methods

list of block-methods

Throws

\SmartyException

Returns

\Smarty|\Smarty_Internal_Template

setCaching()

setCaching(boolean  $caching) 

Parameters

boolean $caching

setCacheLifetime()

setCacheLifetime(integer  $cache_lifetime) 

Parameters

integer $cache_lifetime

setCompileId()

setCompileId(string  $compile_id) 

Parameters

string $compile_id

setCacheId()

setCacheId(string  $cache_id) 

Parameters

string $cache_id

addAutoloadFilters()

addAutoloadFilters(mixed  $filters, string  $type = null) : \Smarty_Internal_TemplateBase

Parameters

mixed $filters
string $type

Returns

\Smarty_Internal_TemplateBase

addDefaultModifier()

addDefaultModifier(mixed  $modifiers) : \Smarty_Internal_TemplateBase

Parameters

mixed $modifiers

Returns

\Smarty_Internal_TemplateBase

createData()

createData(\Smarty_Internal_Data  $parent = null, string  $name = null) : \Smarty_Internal_TemplateBase

Parameters

\Smarty_Internal_Data $parent
string $name

Returns

\Smarty_Internal_TemplateBase

getAutoloadFilters()

getAutoloadFilters(string  $type = null) : array

Parameters

string $type

Returns

array

getDebugTemplate()

getDebugTemplate() : string

Returns

string

getDefaultModifier()

getDefaultModifier() : array

Returns

array

getTags()

getTags(mixed  $template = null) : array

Parameters

mixed $template

Returns

array

getRegisteredObject()

getRegisteredObject(string  $object_name) : object

Parameters

string $object_name

Returns

object

registerCacheResource()

registerCacheResource(string  $name, \Smarty_CacheResource  $resource_handler) : \Smarty_Internal_TemplateBase

Parameters

string $name
\Smarty_CacheResource $resource_handler

Returns

\Smarty_Internal_TemplateBase

registerClass()

registerClass(string  $class_name, string  $class_impl) : \Smarty_Internal_TemplateBase

Parameters

string $class_name
string $class_impl

Returns

\Smarty_Internal_TemplateBase

registerDefaultConfigHandler()

registerDefaultConfigHandler(callback  $callback) : \Smarty_Internal_TemplateBase

Parameters

callback $callback

Returns

\Smarty_Internal_TemplateBase

registerDefaultPluginHandler()

registerDefaultPluginHandler(callback  $callback) : \Smarty_Internal_TemplateBase

Parameters

callback $callback

Returns

\Smarty_Internal_TemplateBase

registerDefaultTemplateHandler()

registerDefaultTemplateHandler(callback  $callback) : \Smarty_Internal_TemplateBase

Parameters

callback $callback

Returns

\Smarty_Internal_TemplateBase

registerResource()

registerResource(string  $name, mixed  $resource_handler) : \Smarty_Internal_TemplateBase

Parameters

string $name
mixed $resource_handler

Returns

\Smarty_Internal_TemplateBase

setAutoloadFilters()

setAutoloadFilters(mixed  $filters, string  $type = null) : \Smarty_Internal_TemplateBase

Parameters

mixed $filters
string $type

Returns

\Smarty_Internal_TemplateBase

setDebugTemplate()

setDebugTemplate(string  $tpl_name) : \Smarty_Internal_TemplateBase

Parameters

string $tpl_name

Returns

\Smarty_Internal_TemplateBase

setDefaultModifier()

setDefaultModifier(mixed  $modifiers) : \Smarty_Internal_TemplateBase

Parameters

mixed $modifiers

Returns

\Smarty_Internal_TemplateBase

unloadFilter()

unloadFilter(string  $type, string  $name) : \Smarty_Internal_TemplateBase

Parameters

string $type
string $name

Returns

\Smarty_Internal_TemplateBase

unregisterCacheResource()

unregisterCacheResource(string  $name) : \Smarty_Internal_TemplateBase

Parameters

string $name

Returns

\Smarty_Internal_TemplateBase

unregisterObject()

unregisterObject(string  $object_name) : \Smarty_Internal_TemplateBase

Parameters

string $object_name

Returns

\Smarty_Internal_TemplateBase

unregisterPlugin()

unregisterPlugin(string  $type, string  $name) : \Smarty_Internal_TemplateBase

Parameters

string $type
string $name

Returns

\Smarty_Internal_TemplateBase

unregisterFilter()

unregisterFilter(string  $type, mixed  $callback) : \Smarty_Internal_TemplateBase

Parameters

string $type
mixed $callback

Returns

\Smarty_Internal_TemplateBase

unregisterResource()

unregisterResource(string  $name) : \Smarty_Internal_TemplateBase

Parameters

string $name

Returns

\Smarty_Internal_TemplateBase

_getSmartyObj()

_getSmartyObj() : \Smarty

Get Smarty object

Returns

\Smarty

getConfigVariable()

getConfigVariable(string  $varName, boolean  $errorEnable = true) : mixed

Parameters

string $varName
boolean $errorEnable

Returns

mixed

getConfigVars()

getConfigVars(string  $varName = null, boolean  $searchParents = true) : mixed

Parameters

string $varName
boolean $searchParents

Returns

mixed

getGlobal()

getGlobal(string  $varName = null) : mixed

Parameters

string $varName

Returns

mixed

getStreamVariable()

getStreamVariable(string  $variable) : mixed

Parameters

string $variable

Returns

mixed

clearAssign()

clearAssign(mixed  $tpl_var) : \Smarty_Internal_Data

Parameters

mixed $tpl_var

Returns

\Smarty_Internal_Data

clearAllAssign()

clearAllAssign() : \Smarty_Internal_Data

Returns

\Smarty_Internal_Data

clearConfig()

clearConfig(string  $varName = null) : \Smarty_Internal_Data

Parameters

string $varName

Returns

\Smarty_Internal_Data

configLoad()

configLoad(string  $config_file, mixed  $sections = null, string  $scope = 'local') : \Smarty_Internal_Data

Parameters

string $config_file
mixed $sections
string $scope

Returns

\Smarty_Internal_Data

_execute()

_execute(string  $template, mixed  $cache_id, mixed  $compile_id, object  $parent, string  $function) : mixed

fetches a rendered Smarty template

Parameters

string $template

the resource handle of the template file or template object

mixed $cache_id

cache id to be used with this template

mixed $compile_id

compile id to be used with this template

object $parent

next higher level of Smarty variables

string $function

function type 0 = fetch, 1 = display, 2 = isCache

Throws

\Exception
\SmartyException

Returns

mixed