public function latestAction() { $domdoc = new DOMDocument(); $domdoc->load(self::Feed); $items = $domdoc->getElementsByTagName('item'); $blogs = array(); foreach ($items as $item) { $be = new BlogEntry(); foreach ($item->childNodes as $childNode) { if ($childNode->nodeName == 'title') { $be->title = $childNode->textContent; } else { if ($childNode->nodeName == 'description') { $be->text = $childNode->textContent; } else { if ($childNode->nodeName == 'pubDate') { $be->date = $childNode->textContent; } } } } $blogs[] = $be; } $sm = new SmartyModel(); $sm->blogs = $blogs; $sm->active_page = 'Home'; $sm->setTerminal(true); return $sm; }
public function renameAction() { $zhue = $this->getServiceLocator()->get('ZHue'); $sm = new SmartyModel(); $sm->lights = $zhue->getLights()->lights; $sm->setTerminal(true); return $sm; }
public function dataAction() { $sm = new SmartyModel(); $sm->active_page = 'Zul'; $p = new Player('the ZUL'); $sm->image = sprintf('<img style="float:left;" src="%s" />', $p->getCharacterImageHttpLocation()); $events = $p->events->getEventsOfType(EventType::LevelUp); $levels = ''; for ($i = 0; $i < 4; $i++) { $levels .= sprintf('%s <br />', $events[$i]->description); } $sm->levels = $levels; $sm->setTerminal(true); return $sm; }
public function indexAction() { $sm = new SmartyModel(); $sm->setTerminal(true); return $sm; }