Пример #1
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->_messageCategory = 'rk-rowaction';
     $this->initI18N('@rokorolov/rowaction', $this->_messageCategory);
     if ($this->deleteMessage === null) {
         $this->deleteMessage = Yii::t($this->_messageCategory, 'Are you sure you want to delete this item?');
     }
     Html::addCssClass($this->actionOptions, 'rk-row-actions');
     $this->initDefaultButtons();
     $this->registerScripts();
 }
 /**
  * Generates the split button.
  * 
  * @return string the rendering result.
  */
 protected function renderButtonDropdown()
 {
     $button = ArrayHelper::remove($this->buttons, $this->status);
     $url = $this->createUrl($this->key, $button['changeTo']);
     $options = $this->options;
     Html::addCssClass($options, 'btn btn-' . $this->size . ' btn-' . $button['type']);
     $options['title'] = ArrayHelper::getValue($this->buttons, $button['changeTo'] . '.label');
     $options['data-pjax'] = '0';
     $options['href'] = Url::to($url);
     return Button::widget(['label' => Html::icon($button['icon']), 'encodeLabel' => false, 'options' => $options, 'tagName' => 'a']);
 }