mirror of
https://github.com/smarty-php/smarty.git
synced 2025-07-31 16:37:14 +02:00
array_map Variable to Variable::getValue in getTemplateVars.
Fixes #994
This commit is contained in:
1
changelog/994.md
Normal file
1
changelog/994.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- Fix that getTemplateVars would return an array of objects instead of the assigned variables values [#994](https://github.com/smarty-php/smarty/issues/994)
|
@@ -224,7 +224,10 @@ class Data
|
|||||||
return $this->getValue($varName, $searchParents);
|
return $this->getValue($varName, $searchParents);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_merge($this->parent && $searchParents ? $this->parent->getTemplateVars() : [], $this->tpl_vars);
|
return array_merge(
|
||||||
|
$this->parent && $searchParents ? $this->parent->getTemplateVars() : [],
|
||||||
|
array_map(function(Variable $var) { return $var->getValue(); }, $this->tpl_vars)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user