\Smarty_Data

class for the Smarty data object

The Smarty data object will hold Smarty variables in the current scope

Summary

Methods
Properties
Constants
assign()
assignGlobal()
assignByRef()
append()
appendByRef()
getTemplateVars()
clearAssign()
clearAllAssign()
configLoad()
getVariable()
getConfigVariable()
getStreamVariable()
getConfigVars()
clearConfig()
__construct()
$template_class
$tpl_vars
$parent
$config_vars
$smarty
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$template_class

$template_class : string

name of class used for templates

Type

string

$tpl_vars

$tpl_vars : array

template variables

Type

array

$config_vars

$config_vars : array

configuration settings

Type

array

$smarty

$smarty : \Smarty

Smarty object

Type

\Smarty

Methods

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

assignGlobal()

assignGlobal(string  $varname, mixed  $value = null, boolean  $nocache = false) : \Smarty_Internal_Data

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

current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

assignByRef()

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

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

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

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

current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

appendByRef()

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

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

current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

getTemplateVars()

getTemplateVars(string  $varname = null, string  $_ptr = null, boolean  $search_parents = true) : string

Returns a single or all template variables

Parameters

string $varname

variable name or null

string $_ptr

optional pointer to data object

boolean $search_parents

include parent templates?

Returns

string —

variable value or or array of variables

clearAssign()

clearAssign(string|array  $tpl_var) : \Smarty_Internal_Data

clear the given assigned template variable.

Parameters

string|array $tpl_var

the template variable(s) to clear

Returns

\Smarty_Internal_Data

current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

clearAllAssign()

clearAllAssign() : \Smarty_Internal_Data

clear all the assigned template variables.

Returns

\Smarty_Internal_Data

current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

configLoad()

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

load a config file, optionally load just selected sections

Parameters

string $config_file

filename

mixed $sections

array of section names, single section or null

Returns

\Smarty_Internal_Data

current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

getVariable()

getVariable(string  $variable, object  $_ptr = null, boolean  $search_parents = true,   $error_enable = true) : object

gets the object of a Smarty variable

Parameters

string $variable

the name of the Smarty variable

object $_ptr

optional pointer to data object

boolean $search_parents

search also in parent data

$error_enable

Returns

object —

the object of the variable

getConfigVariable()

getConfigVariable(string  $variable,   $error_enable = true) : mixed

gets a config variable

Parameters

string $variable

the name of the config variable

$error_enable

Returns

mixed —

the value of the config variable

getStreamVariable()

getStreamVariable(string  $variable) : mixed

gets a stream variable

Parameters

string $variable

the stream of the variable

Returns

mixed —

the value of the stream variable

getConfigVars()

getConfigVars(string  $varname = null,   $search_parents = true) : string

Returns a single or all config variables

Parameters

string $varname

variable name or null

$search_parents

Returns

string —

variable value or or array of variables

clearConfig()

clearConfig(string  $varname = null) : \Smarty_Internal_Data

Deassigns a single or all config variables

Parameters

string $varname

variable name or null

Returns

\Smarty_Internal_Data

current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining

__construct()

__construct(\Smarty|array  $_parent = null, \Smarty  $smarty = null) 

create Smarty data object

Parameters

\Smarty|array $_parent

parent template

\Smarty $smarty

global smarty instance