I have a snippet which serves to hold a PHP array that gets passed to other snippets. Lets call it "baseArray":
$category_array = array(
"acupuncture" => "Acupuncture",
"advertising" => "Advertising",
"apparel" => "Apparel",
);
return $category_array;
I would like to enable another snippet to take the array and process it as a PHP array. But when I try something like this it fails:
$category_array = $modx->runSnippet('baseArray');
foreach($category_array as $category_id => $category_name) {
$output .= '<li>' . $category_name . '</li>';
}
return $output;
The above snippet does not return anything. It is receiving some sort of object from the first snippet but it does not appear to be a straight PHP array.
Any help greatly appreciated.