src/widgets/ArraySpoiler.php
protected function renderButtonSpoiler()
    {
        $options = ArrayHelper::merge([
            'role' => 'button',
            'data-spoiler-group' => 'main',
            'data-spoiler-toggle' => true,
            'data-target' => $this->button['id'] . '-body',
        ], $this->button);

        $label = $this->getButtonLabel(ArrayHelper::remove($options, 'label'));

        $this->parts['{button}'] = Html::tag(ArrayHelper::remove($options, 'tag'), $label, $options);
        $this->getView()->registerJs("
             $('[data-spoiler-toggle]').click(function (e) {
                $('#'+$(this).data('target')).toggle();
                $('[data-spoiler-group=\"{$options['data-spoiler-group']}\"]').not($(this)).trigger('hide');
             }).on('hide', function () {
                $('#'+$(this).data('target')).hide();
             })",
            View::POS_READY);
    }
protected function renderButtonSpoiler()
    {
        $options = ArrayHelper::merge([
            'role' => 'button',
            'data-spoiler-group' => 'main',
            'data-spoiler-toggle' => true,
            'data-target' => $this->button['id'] . '-body',
        ], $this->button);

        $label = $this->getButtonLabel(ArrayHelper::remove($options, 'label'));

        $this->parts['{button}'] = Html::tag(ArrayHelper::remove($options, 'tag'), $label, $options);
        $this->getView()->registerJs("
             $('[data-spoiler-toggle]').click(function (e) {
                $('#'+$(this).data('target')).toggle();
                $('[data-spoiler-group=\"{$options['data-spoiler-group']}\"]').not($(this)).trigger('hide');
             }).on('hide', function () {
                $('#'+$(this).data('target')).hide();
             })",
            View::POS_READY);
    }
protected function renderButtonSpoiler ( ) { $ options = ArrayHelper :: merge ( [ 'role' => 'button' , 'data-spoiler-group' => 'main' , 'data-spoiler-toggle' => true , 'data-target' => $ this -> button [ 'id' ] . '-body' , ] , $ this -> button ) ; $ label = $ this -> getButtonLabel ( ArrayHelper :: remove ( $ options , 'label' ) ) ; $ this -> parts [ '{button}' ] = Html :: tag ( ArrayHelper :: remove ( $ options , 'tag' ) , $ label , $ options ) ; $ this -> getView ( ) -> registerJs ( "
             $('[data-spoiler-toggle]').click(function (e) {
                $('#'+$(this).data('target')).toggle();
                $('[data-spoiler-group=\"{$options['data-spoiler-group']}\"]').not($(this)).trigger('hide');
             }).on('hide', function () {
                $('#'+$(this).data('target')).hide();
             })" , View :: POS_READY ) ; }
Renders a button for spoiler activator.

Additional special options, that will be extracted from [[$this->button]]:
- `data-popover-group` - Group of popovers. Is used to close all other popovers in group, when new one is opening. Default: 'main'

@see http://getbootstrap.com/javascript/#popovers-options
Renders a button for spoiler activator .