public function getLabelAttribute() { $label = \iElem::make('span')->className('label')->attr('style', 'background:' . $this->color); $bg = " style='background:{$this->color}'"; $icon = "<i class='icon-{$this->icon} icon-large'></i>"; switch ($this->view) { case 0: return "<span class='label label-default'{$bg}>{$icon} {$this->title}</span>"; case 1: return "<span class='label label-default'{$bg} title='{$this->title}'>{$icon}</span>"; case 2: return "<span class='label label-default'{$bg}>{$this->title}</span>"; case 3: return "<i class='icon-{$this->icon} icon-large' style='color:{$this->color}' title='{$this->title}'></i>"; } }
public function icon($icon) { // '<span class="label label-danger">3</span>' $this->currentItem->child()->beforeText(iElem::make('i')->className('icon-' . $icon)); return $this; }