I'm fairly sure you can't do anything of the sort in Smarty 2, barring the use of {php}{/php}
inside the template itself: http://www.smarty.net/docsv2/en/language.function.php.tpl -- but that's not what you're looking for.
It's easy in Smarty 3 though.
The syntax in the link you provided ['foo'=>'bar',...]
is Smarty 3 syntax.