'Smarty array add child object

Hi I am working out how do this in two parts.

This works if I do this all to togther {$var = ['foo' => 'bar', 'sub' => [1, 2, 3]]}

I want to do it something like

{$var = ['foo' => 'bar'}

Then add the sub suff later.

{$var = 'sub' => [1, 2, 3]]}

{$var = ['foo2' => 'bar2'}

How can do this?

Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source