Smarty plugin, pass by reference

139 views Asked by At

I need to write a custom recursive function for displaying a tree structure. The function signature is as follows:

function smarty_function_categories($params, &$smarty)

My problem is that I cannot declare $params as &$params as this is not accepted by smarty. Moreover into $params I want to pass two large tables holding the tree data and I cannot have them copied in every recursion. $params is a PHP associative array. Any ideas - suggestions?

0

There are 0 answers