src/Combo.php
public function getPluginOptions($options = [])
    {
        $defaultOptions = [
            'name' => $this->name,
            'type' => $this->type,
            'hasId' => $this->hasId,
            'select2Options' => [
                'width'       => '100%',
                'placeholder' => '----------',
                'minimumInputLength' => '0',
                'ajax'        => [
                    'url'    => Url::toRoute($this->url),
                    'type'   => 'post',
                    'return' => $this->return,
                    'rename' => $this->rename,
                    'filter' => $this->filter,
                    'data' => new JsExpression("
                        function (event) {
                            return $(this).data('field').createFilter($.extend(true, {
                                '{$this->primaryFilter}': {format: event.term}
                            }, event.filters || {}));
                        }
                    "),
                ],
            ],
        ];
        if ($this->multiple && $this->selectAllButton) {
            Select2SelectAllAsset::register($this->view);
            $defaultOptions = ArrayHelper::merge($defaultOptions, [
                'select2Options' => [
                    'tags' => false,
                    'tokenSeparators' => [',', ', ', ' '],
                    'dropdownAdapter' => new JsExpression('$.fn.select2.amd.require("select2/custom/dropdown-adapter/select-all")'),
                ],
            ]);
        }

        return ArrayHelper::merge($defaultOptions, $this->_pluginOptions, $options);
    }
public function getPluginOptions($options = [])
    {
        $defaultOptions = [
            'name' => $this->name,
            'type' => $this->type,
            'hasId' => $this->hasId,
            'select2Options' => [
                'width'       => '100%',
                'placeholder' => '----------',
                'minimumInputLength' => '0',
                'ajax'        => [
                    'url'    => Url::toRoute($this->url),
                    'type'   => 'post',
                    'return' => $this->return,
                    'rename' => $this->rename,
                    'filter' => $this->filter,
                    'data' => new JsExpression("
                        function (event) {
                            return $(this).data('field').createFilter($.extend(true, {
                                '{$this->primaryFilter}': {format: event.term}
                            }, event.filters || {}));
                        }
                    "),
                ],
            ],
        ];
        if ($this->multiple && $this->selectAllButton) {
            Select2SelectAllAsset::register($this->view);
            $defaultOptions = ArrayHelper::merge($defaultOptions, [
                'select2Options' => [
                    'tags' => false,
                    'tokenSeparators' => [',', ', ', ' '],
                    'dropdownAdapter' => new JsExpression('$.fn.select2.amd.require("select2/custom/dropdown-adapter/select-all")'),
                ],
            ]);
        }

        return ArrayHelper::merge($defaultOptions, $this->_pluginOptions, $options);
    }
Returns the config of the Combo, merges with the passed $config.

@param array $options
@return array