In my php code.
$version_config = array(
"list" => array(
"123"
),
... other params
)
$this->getView()->assign('version_config', $version_config);
$this->getView()->assign('version_list', $version_config['list']);
In my tpl code,
{assign var="version_list2" value="{$version_config.list}"}
{$version_list2}
is a string values "Array" while {$version_list2}
is an array. Do I need some more operations to encode {$version_list2}
to an array?
The double quotes are converting $version_config.list
array to string "Array"
just as "{$version_config['list']}"
in PHP.
Also, there is no need for curly braces in the value. Simply pass the variable in the value
parameter:
{assign var="version_list2" value=$version_config.list}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With