mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-04 19:54:14 +02:00
- bugfix on assigning multidimensional arrays within templates
- corrected bugfix for truncate modifier
This commit is contained in:
@@ -806,6 +806,26 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a loacal Smarty variable for array assihgments
|
||||
*/
|
||||
public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = SMARTY_LOCAL_SCOPE)
|
||||
{
|
||||
if (!isset($this->tpl_vars[$tpl_var])) {
|
||||
$tpl_var_inst = $this->getVariable($tpl_var, null, true, false);
|
||||
if ($tpl_var_inst instanceof Undefined_Smarty_Variable) {
|
||||
$this->tpl_vars[$tpl_var] = new Smarty_variable(array(), $nocache, $scope);
|
||||
} else {
|
||||
$this->tpl_vars[$tpl_var] = clone $tpl_var_inst;
|
||||
if ($scope != SMARTY_LOCAL_SCOPE) {
|
||||
$this->tpl_vars[$tpl_var]->scope = $scope;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(is_array($this->tpl_vars[$tpl_var]->value) || $this->tpl_vars[$tpl_var]->value instanceof ArrayAccess)) {
|
||||
settype($this->tpl_vars[$tpl_var]->value, 'array');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* wrapper for display
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user