public function render() { if ($this->icon) { $label = Html::icon($this->icon) . ' ' . Html::escape($this->label); } else { $label = Html::escape($this->label); } echo Html::element($this->tag, $this->attributes, $label); }
/** * Render the items. */ public function renderContents() { foreach ($this->items as $url => $action) { if (is_int($url) && is_string($action)) { echo "\t<li class=\"nav-header\">" . Html::escape($action) . "</li>\n"; } else { echo "\t<li><a href=\"" . $url . '">'; if (is_array($action)) { // has an icon? echo Html::icon($action['icon']), ' ', Html::escape($action['label']); } else { echo Html::escape($action); } echo "</a></li>\n"; } } }
public function renderContents() { echo "\n"; foreach ($this->crumbs as $crumb) { if ($crumb['url'] == false || \Sledgehammer\value($crumb['active'])) { echo "\t<li class=\"active\">"; } else { echo "\t<li>"; } if (isset($crumb['icon'])) { $label = Html::icon($crumb['icon']) . ' ' . Html::escape($crumb['label']); } else { $label = Html::escape($crumb['label']); } if ($crumb['url']) { echo Html::element('a', array('href' => $crumb['url']), $label); } else { echo $label; } echo "</li>\n"; } }