/** * @param $class * @param null $params * @param bool $return * @return string|void */ public function widget($class, $params = null, $return = false) { $widget = Factory::getWidget($class, $params, $this); $widget->begin(); $buffer = $widget->end(); if ($return) { return $buffer; } echo $buffer; }
public function html() { $this->begin(); $this->fetchViewPath(); $this->fetchViewFile(); $widget = Factory::getWidget('\\Flywheel\\Html\\Widget\\Menu', $this->getRender()); if (isset($this->lists['items'])) { $widget->items = $this->lists['items']; } $widget->begin(); $widget->viewFile = $this->viewFile; $widget->viewPath = preg_replace('#/+#', '/', $this->viewPath); $buffer = $widget->render(array('items' => $widget->items)); return $buffer; }