src/widgets/ModalButton.php
public function renderButton()
    {
        if (($button = $this->button) !== false) {
            $tag = ArrayHelper::remove($button, 'tag', 'a');
            $label = ArrayHelper::remove($button, 'label',
                Inflector::camel2words(Inflector::id2camel($this->scenario)));
            if ($tag === 'button' && !isset($button['type'])) {
                $toggleButton['type'] = 'button';
            }

            if ($button['disabled']) {
                $button = ArrayHelper::merge([
                    'onClick' => new JsExpression('return false'),
                ], $button);
            } else {
                $button = ArrayHelper::merge([
                    'data-toggle' => 'modal',
                    'data-target' => "#{$this->getModalId()}",
                ], $button);
            }

            if ($tag === 'a' && empty($button['href'])) {
                $button['href'] = '#';
            }

            echo Html::tag($tag, $label, $button);
        }
    }
public function renderButton()
    {
        if (($button = $this->button) !== false) {
            $tag = ArrayHelper::remove($button, 'tag', 'a');
            $label = ArrayHelper::remove($button, 'label',
                Inflector::camel2words(Inflector::id2camel($this->scenario)));
            if ($tag === 'button' && !isset($button['type'])) {
                $toggleButton['type'] = 'button';
            }

            if ($button['disabled']) {
                $button = ArrayHelper::merge([
                    'onClick' => new JsExpression('return false'),
                ], $button);
            } else {
                $button = ArrayHelper::merge([
                    'data-toggle' => 'modal',
                    'data-target' => "#{$this->getModalId()}",
                ], $button);
            }

            if ($tag === 'a' && empty($button['href'])) {
                $button['href'] = '#';
            }

            echo Html::tag($tag, $label, $button);
        }
    }
public function renderButton ( ) { if ( ( $ button = $ this -> button ) !== false ) { $ tag = ArrayHelper :: remove ( $ button , 'tag' , 'a' ) ; $ label = ArrayHelper :: remove ( $ button , 'label' , Inflector :: camel2words ( Inflector :: id2camel ( $ this -> scenario ) ) ) ; if ( $ tag === 'button' && ! isset ( $ button [ 'type' ] ) ) { $ toggleButton [ 'type' ] = 'button' ; } if ( $ button [ 'disabled' ] ) { $ button = ArrayHelper :: merge ( [ 'onClick' => new JsExpression ( 'return false' ) , ] , $ button ) ; } else { $ button = ArrayHelper :: merge ( [ 'data-toggle' => 'modal' , 'data-target' => "#{$this->getModalId()}" , ] , $ button ) ; } if ( $ tag === 'a' && empty ( $ button [ 'href' ] ) ) { $ button [ 'href' ] = '#' ; } echo Html :: tag ( $ tag , $ label , $ button ) ; } }
Renders toggle button.
Renders toggle button .