src/widgets/HiBox.php
protected function renderButtons()
    {
        // Box tools
        if ($this->buttonsTemplate !== null && !empty($this->boxTools)) {
            // Begin box tools
            echo Html::beginTag('div', ['class' => 'box-tools pull-right']);
            echo preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) {
                $name = $matches[1];
                if (isset($this->boxTools[$name])) {
                    $label = isset($this->boxTools[$name]['label']) ? $this->boxTools[$name]['label'] : '';

                    $icon = isset($this->boxTools[$name]['icon']) ? Html::tag('i', '', ['class' => 'fa ' . $this->boxTools[$name]['icon']]) : '';
                    $label = $icon . ' ' . $label;
                    $this->boxTools[$name]['options']['class'] = isset($this->boxTools[$name]['options']['class']) ? 'btn btn-sm ' . $this->boxTools[$name]['options']['class'] : 'btn btn-sm';

                    return Html::button($label, $this->boxTools[$name]['options']);
                } else {
                    return '';
                }
            }, $this->buttonsTemplate);
            // End box tools
            echo Html::endTag('div');
        }
    }
protected function renderButtons()
    {
        // Box tools
        if ($this->buttonsTemplate !== null && !empty($this->boxTools)) {
            // Begin box tools
            echo Html::beginTag('div', ['class' => 'box-tools pull-right']);
            echo preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) {
                $name = $matches[1];
                if (isset($this->boxTools[$name])) {
                    $label = isset($this->boxTools[$name]['label']) ? $this->boxTools[$name]['label'] : '';

                    $icon = isset($this->boxTools[$name]['icon']) ? Html::tag('i', '', ['class' => 'fa ' . $this->boxTools[$name]['icon']]) : '';
                    $label = $icon . ' ' . $label;
                    $this->boxTools[$name]['options']['class'] = isset($this->boxTools[$name]['options']['class']) ? 'btn btn-sm ' . $this->boxTools[$name]['options']['class'] : 'btn btn-sm';

                    return Html::button($label, $this->boxTools[$name]['options']);
                } else {
                    return '';
                }
            }, $this->buttonsTemplate);
            // End box tools
            echo Html::endTag('div');
        }
    }
protected function renderButtons ( ) { // Box tools if ( $ this -> buttonsTemplate !== null && ! empty ( $ this -> boxTools ) ) { // Begin box tools echo Html :: beginTag ( 'div' , [ 'class' => 'box-tools pull-right' ] ) ; echo preg_replace_callback ( '/\\{([\w\-\/]+)\\}/' , function ( $ matches ) { $ name = $ matches [ 1 ] ; if ( isset ( $ this -> boxTools [ $ name ] ) ) { $ label = isset ( $ this -> boxTools [ $ name ] [ 'label' ] ) ? $ this -> boxTools [ $ name ] [ 'label' ] : '' ; $ icon = isset ( $ this -> boxTools [ $ name ] [ 'icon' ] ) ? Html :: tag ( 'i' , '' , [ 'class' => 'fa ' . $ this -> boxTools [ $ name ] [ 'icon' ] ] ) : '' ; $ label = $ icon . ' ' . $ label ; $ this -> boxTools [ $ name ] [ 'options' ] [ 'class' ] = isset ( $ this -> boxTools [ $ name ] [ 'options' ] [ 'class' ] ) ? 'btn btn-sm ' . $ this -> boxTools [ $ name ] [ 'options' ] [ 'class' ] : 'btn btn-sm' ; return Html :: button ( $ label , $ this -> boxTools [ $ name ] [ 'options' ] ) ; } else { return '' ; } } , $ this -> buttonsTemplate ) ; // End box tools echo Html :: endTag ( 'div' ) ; } }
Render widget tools button.
Render widget tools button .