<?php
class ListTemplate extends SimpleTemplate {
var $items; /* SimpleIterator */
function ListTemplate(&$items) {
parent::SimpleTemplate();
$this->items =& $items;
}
function display($list_template,$item_template) {
$items =& $this->items;
$items->reset();
while ( $items->next() ) {
$item_tpl =& new SimpleTemplate($items->export());
$this->append('list',$item_tpl->fetch($item_template,SO_TEMPLATE_FILE));
}
echo $this->fetch($list_template,SO_TEMPLATE_FILE);
}
}
?>
|