Hello
I have an array of docs and wanted to output it by parsing a chunk
if(count($docs)>0){
$chunk = $modx->getObject('modChunk',array(
'name' => 'savedRequests',
));
foreach ($docs as $o) {
if (!$chunk) return 'No line item chunk!';
else $output .= $chunk->getContent();
$output .= $chunk->process($o);
//$output .= '<a href="[[~'.$o["id"].']]">system Id#'.$o["id"].', by '.$o["pagetitle"].'</a> <br />';
}
return $output .'<br > total: '.count($docs);
}
As you can see I have a commented line of output: $output .= '<a href="[[~'.$o["id"].']]">system Id#'.$o["id"].', by '.$o["pagetitle"].'</a>
'; which works but parsing chunk not works because I probably don't really parse it correctly..
Pls correct my code, thanks