Smarty_Internal_Data
Base class with template and variable methods
- Full name:
\Smarty_Internal_Data
- This class is an Abstract class
Properties
_objType
This object type (Smarty = 1, template = 2, data = 4)
template_class
name of class used for templates
tpl_vars
template variables
parent
parent template (if any)
config_vars
configuration settings
ext
extension handler
Methods
__construct
Smarty_Internal_Data constructor.
Install extension handler
assign
assigns a Smarty variable
public assign(array|string $tpl_var, mixed $value = null, bool $nocache = false): \Smarty_Internal_Data
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl_var |
array|string | the template variable name(s) |
$value |
mixed | the value to assign |
$nocache |
bool | if true any output of this variable will be not cached |
Return Value:
current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
append
appends values to template variables
public append(array|string $tpl_var, mixed $value = null, bool $merge = false, bool $nocache = false): \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl_var |
array|string | the template variable name(s) |
$value |
mixed | the value to append |
$merge |
bool | flag if array elements shall be merged |
$nocache |
bool | if true any output of this variable will be not cached |
See Also:
- https://www.smarty.net/docs/en/api.append.tpl -
assignGlobal
assigns a global Smarty variable
public assignGlobal(string $varName, mixed $value = null, bool $nocache = false): \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
Parameters:
Parameter | Type | Description |
---|---|---|
$varName |
string | the global variable name |
$value |
mixed | the value to assign |
$nocache |
bool | if true any output of this variable will be not cached |
appendByRef
appends values to template variables by reference
public appendByRef(string $tpl_var, mixed& $value, bool $merge = false): \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl_var |
string | the template variable name |
$value |
mixed | the referenced value to append |
$merge |
bool | flag if array elements shall be merged |
assignByRef
assigns values to template variables by reference
public assignByRef(string $tpl_var, mixed& $value, bool $nocache = false): \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
Parameters:
Parameter | Type | Description |
---|---|---|
$tpl_var |
string | the template variable name |
$value |
mixed | |
$nocache |
bool | if true any output of this variable will be not cached |
getTemplateVars
Returns a single or all template variables
public getTemplateVars(string $varName = null, \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr = null, bool $searchParents = true): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$varName |
string | variable name or null |
$_ptr |
\Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty | optional pointer to data object |
$searchParents |
bool | include parent templates? |
Return Value:
variable value or or array of variables
See Also:
- https://www.smarty.net/docs/en/api.get.template.vars.tpl -
_mergeVars
Follow the parent chain an merge template and config variables
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
\Smarty_Internal_Data|null |
_isDataObj
Return true if this instance is a Data obj
_isTplObj
Return true if this instance is a template obj
_isSmartyObj
Return true if this instance is a Smarty obj
_getSmartyObj
Get Smarty object
__call
Handle unknown class methods
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | unknown method-name |
$args |
array | argument array |
Automatically generated on 2025-03-18