First, off there were two problems : a parsing problem as I expected and the conflict with PHx.
The parsing call was dealt with as seen in the code below. Specifically, the variable that was to contain
the CSS-formatted output was initialized and closed-out inside the main "if" statement. Put differentlly,
I changed the logic to ensure that the call to setPlaceHolder was the last thing executed, if it was going to
be executed at all.
if ($modx->db->getRecordCount($ds) > 0)
{
$createList = '<table class="catalog"><tbody><tr><td class="desccell">Description</td><td class="cat_numcell">Code</td><td class="pricecell">Price</td></tr>';
while($row = $modx->db->getRow($ds))
{
$key = '';
$value = '';
$chunk_tpl = 'show_table_row'; // name of chunk
$chunkTpl = $modx->getChunk($chunk_tpl);
//$chunkTpl = '<tr><td class="desccell">[+desc+]</td><td class="pricecell">[+price+]</td></tr><br />';
foreach($row as $key => $value)
{
$chunkTpl = str_replace('[+' . $key . '+]', $value, $chunkTpl);
}
//echo $chunkTpl;
$createList .= $chunkTpl;
}
$createList .= '</tbody></table>';
$placeholder_tpl = 'show_table_results'; // name of placeholder
$modx->setPlaceHolder($placeholder_tpl, $createList);
}
else
{
echo 'No results found.';
}
With PHx disabled and the call
[!snippet_name!]
[+show_table_results+]
in a template called from a cacheable document, this worked fine.
With PHx enabled though, this no longer worked. So I adopted the same approach as with Ditto :
the call to the snippet was changed from "[!snippet_name!]" to "[[snippet_name]]" (i.e. uncached to cached call).
*Unlike* the apparoach with Ditto it did not matter if the document that used the template which made the call was set to *non*-cacheable (i.e. the check mark was removed)
Once this was done, the output was correctly formatted.
Matt