<?php
$path = MODX_CORE_PATH . 'components/extra/';
$result = $modx->addPackage('extra',$path .
'model/','bobs_extra_');
if (! $result) {
return 'failed to add package';
} else {
$output = '<p>added Package</p>';
}
$quotes = $modx->getCollection('Quotation');
$output .= '<p>Total: '. count($quotes) . '</p>';
foreach($quotes as $quote) {
$fields = $quote->toArray();
$output .= $modx->getChunk('ShowQuote', $fields);
}
return $output;This question has been answered by BobRay. See the first response.
$quotes = $modx->getCollection('Quotation');$query = $modx->newQuery('Quotation');
$query->limit(4);
$quotes = $modx->getCollection('Quotation', $query);