Hey, I was wondering if it was possible to pass an associative array as a parameter in a custom function. This is my scenario:
In the php file I set the array:
$dataArr = array('one'=>'1','two'=>'2','three'=>'3');
$tpl->assign('dataArr',$dataArr);
This is my custom function dulled down
function smarty_function_drawChart($params, &$smarty){
print_r($params);
}
This is my function call in the template
{drawChart data={$dataArr} title='Title of the Chart'}
The problem I am having is that if you notice where I print_r($params), that shows:
Array
(
[data] => Array
[title] => Title of the Chart
)
It seems to be passing the string 'Array' rather than the actual array. I have done debugging right before passing the $dataArr that shows {$dataArr.one} has a value. Once inside my custom function $params['data'].one does not exist.
Any ideas on what I am doing wrong?
Thanks
Levi