This is an old thread, but it seems the problem is still not resolved: I have a snippet that needs to accept a multi-dimensional array as a parameter, such as
$field_array = array(
'year' => array('textBox','Year','','5',1,'Please enter a year'),
'semester' => array('dropdown','Semester',array(1=>array('1','selected'),2=>array('2','selected')),'','')
);
The snippet then calls an eval() on the array value, creating a variable $field_array within the snippet.
I’m having the same problem described in this post earlier: with the default MODx installation, the snippet only ever gets "$field_array " passed into it. I modified the document.parser.class.in.php file as described, and now I get "$field_array = array(’year’ " - it gets stuck on the second equal sign.
If I store the code as a chunk, and call that into the variable, the page just spits the snippet call back at me, without evaluating it.
Any ideas on what’s going on here? Currently, I’m dealing with simple two-dimensional arrays by passing them in as a listlist, but this doesn’t quite work if the entries can be two-dimensional arrays such as the one above...
Thanks,
Jan