<?php $output = ''; $sql = "SELECT * FROM modx_users"; foreach ($modx->query($sql) as $row) { $properties['id'] = $row['id']; $properties['username'] = $row['username']; } $output = $modx->getChunk($tpl,$properties); return $output;
id [[+id]] / user [[+username]]
<?php $output = ''; $sql = "SELECT * FROM modx_users"; foreach ($modx->query($sql) as $row) { $output .= $row['id'] .' '; } return $output;
<?php $output = ''; $sql = "SELECT * FROM modx_users"; foreach ($modx->query($sql) as $row) { $output.= "id ".$row['id'] ."/ user ".$row['username']."\n"; } return $output;
<?php $output = ''; $sql = "SELECT * FROM modx_users"; foreach ($modx->query($sql) as $row) { $output .= $modx->getChunk('mychunk', $row); } return $output;