Beispiel #1
0
$model = new MenuModel();
// create view
$view = new MenuView();
// collect data
$data = array();
// time
$data['TIME'] = $model->getTime();
// cave selector
$data['SELECT'] = $model->getSelector();
// fill menu icons
$icons = $model->getIcons();
foreach ($icons as $icon) {
    $data['ICON'][] = $icon->getTmplData();
}
// fill menu items
$items = $model->getItems();
foreach ($items as $item) {
    $data['ITEM'][] = $item->getTmplData();
}
// set data
$view->setTmplData($data);
// get view's output
$output = $view->toString();
// replace gfx-path and output result
$gfx = $params->SESSION->nogfx ? DEFAULT_GFX_PATH : $params->SESSION->player->gfxpath;
echo str_replace('%gfx%', $gfx, $output);
################################################################################
// close page
page_end();
################################################################################
/** This class is currently just a placeholder till I find my enlightenment..