Quote from: PatrickSamphire at Jul 03, 2007, 10:25 AM
How exactly would you use that? Would you simply put it into the while loop, like this:
while($row=$modx->fetchRow($rs)) {
$output .= $modx->parseChunk('myTpl', $modx->placeholders, '[+', '+]');
}
Or is it more complicated than that?
Nope, simple as that, though you need to set your placeholders on each loop. I was just trying to show that you can use any associative array as the replacement variables.
while($row=$modx->fetchRow($rs)) {
$modx->placeholders= array_merge($modx->placeholders, $row); // merge the row values into global placeholders
$output .= $modx->parseChunk('myTpl', $modx->placeholders, '[+', '+]');
}
Quote from: heliotrope at Jul 03, 2007, 10:02 AM
but If you want to use file system to store your chunk you cannot use this one(parseChunk).
Storing it on the file system would mean it’s not a chunk, cause those are by definition stored in the DB. When the core changes for 0.9.7 are introduced, you will be able to provide a "chunk"-like content element and define the content as a simple path to a file on the file system to accomplish this and have the core parsing logic applied consistently.