getChunk() wants an associative array for that second argument. For each key in the array, It will replace the placeholders in the chunk with that keyname with the associated value:
<?php
$props = array('name'=>'John Doe');
return $modx->getChunk('ChunkName',$props);
?>
The easiest way to handle this is to put the key/value pairs in a standalone property set (let’s call it ’MyProps’ and we’ll call the snippet ’Replace’). The snippet tag and code would look something like this:
[[!Replace? &chunkName=`myTpl` &propSet=`MyProps`]]
<?php
/* Replace snippet */
$set = $modx->getObject('modPropertySet',array('name'=>$propSet));
$props = $set->getProperties();
$output .= $modx->getChunk($myTpl, $props);
return $output;
?>
Then, just put the placeholders in the myTpl chunk and the the placeholder names / replacement values in the MyProps property set.