Esempio n. 1
0
 /**
  * Renders the button
  */
 public function renderButton()
 {
     if (!empty($this->buttonOptions) && is_array($this->buttonOptions)) {
         \bootstrap\helpers\BSArray::defaultValue('data-toggle', 'modal', $this->buttonOptions);
         if ($this->remote !== null) {
             $this->buttonOptions['data-remote'] = CHtml::normalizeUrl($this->remote);
         }
         $selector = '#' . $this->htmlOptions['id'];
         $label = \bootstrap\helpers\BSArray::popValue('label', $this->buttonOptions, 'button');
         $attr = isset($this->buttonOptions['data-remote']) ? 'data-target' : 'href';
         \bootstrap\helpers\BSArray::defaultValue($attr, $selector, $this->buttonOptions);
         echo BSHtml::button($label, $this->buttonOptions);
     }
 }