Ejemplo n.º 1
0
 /**
  * Renders the widget.
  */
 public function run()
 {
     $this->registerPlugin('button');
     $this->label = $this->getLabel();
     if ($this->enableIcon) {
         $this->label .= Icon::widget(['label' => $this->icon, 'options' => $this->iconOptions]);
     }
     return Html::tag($this->tagName, $this->label, $this->options);
 }
Ejemplo n.º 2
0
 /**
  * @param null $icon
  * @param array $options
  * @return $this
  */
 public function icon($icon, $options = [])
 {
     if ($icon === false) {
         $this->parts['{icon}'] = '';
         return $this;
     }
     $options = array_merge($this->iconOptions, $options);
     $this->parts['{icon}'] = Icon::widget(['name' => $icon, 'options' => $options]);
     return $this;
 }