I have an extra with a function in it:
public function displayData($scriptProperties){
$view = $scriptProperties['view'];
$dataOut = '';
switch ($view){
// display program data
case 'programs' :
$programs = $this->modx->getCollectionGraph('Programs', '{ "ProgramNames":{},"Locations":{},"StatusFlags":{} }');
if(!$programs) return 'not a collection';
foreach ($programs as $program){
if (is_object($program)){
$programData = $program->toArray();
$programData['prog_name'] = $program->ProgramNames->get('name');
$programData['prog_comment'] = $program->ProgramNames->get('comment');
$programData['status_flag'] = $program->StatusFlags->get('flag');
$programData['loc_name'] = $program->Locations->get('location');
}
$dataOut .= $this->modx->getChunk('ProgramsViewRowTpl',$programData);
echo '<pre>';print_r($dataOut);echo '</pre>'; // shows content of $dataOut
}
echo '<pre>';print_r($dataOut);echo '</pre>'; // shows nothing!! blank page
$output = $this->modx->getChunk('ProgramsViewWrapperTpl',array('programdata'=>$dataOut,));
return $output;
break;
}
} // end getPrograms
It was working perfectly, displaying output in a nice table. Now when I run it, the only thing I get is the content of ProgramsViewRowTpl [if I view the source] ONLY, no html for the template is there, nothing only the output of the ProgramsViewRowTpl.
here is ProgramsViewWrapperTpl: [this is not displayed]
<!-- ProgramsViewWrapperTpl -->
<table class="table">
<thead>
<tr>
<th>Location</th>
<th>Fund</th>
<th>Start Balance</th>
<th>End Balance</th>
<th>Start Date</th>
<th>End Date</th>
<th>Status</th>
</tr>
</thead>
<tbody>
[[+programdata]]
</tbody>
</table>
and here is ProgramsViewRowTpl :
<!-- ProgramsViewRowTpl -->
<tr>
<td>[[+loc_name]]</td>
<td>[[+prog_name]]</td>
<td>[[+start_balance]]</td>
<td>[[+end_balance]]</td>
<td>[[+start_date]]</td>
<td>[[+end_date]]</td>
<td>[[+status_flag]]</td>
</tr>
<!--[[+id]][[+created]][[+modified]][[+status_id]][[+location_id]][[+program_name_id]][[+start_date]][[+end_date]][[+start_balance]][[+end_balance]][[+comment]][[+prog_name]][[+prog_comment]][[+status_flag]][[+loc_name]]-->
everything seems to execute fine right up until:$output = $this->modx->getChunk('ProgramsViewWrapperTpl',array('programdata'=>$dataOut,));
any ideas???