Switchery.php
protected function registerPlugin()
    {
        if (!isset($this->options['id'])) {
            $this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
        } else {
            $this->setId($this->options['id']);
        }
        
        $clientOptions = [];
        $this->clientOptions = ArrayHelper::merge($clientOptions, $this->clientOptions);
        
        if ($this->hasModel()) {
            $this->querySelector = '#' . $this->options['id'];
        } elseif (empty($this->querySelector)) {
            $this->querySelector = ArrayHelper::remove($this->clientOptions, 'querySelector', '#' . $this->options['id']);
        }
    }
protected function registerPlugin()
    {
        if (!isset($this->options['id'])) {
            $this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
        } else {
            $this->setId($this->options['id']);
        }
        
        $clientOptions = [];
        $this->clientOptions = ArrayHelper::merge($clientOptions, $this->clientOptions);
        
        if ($this->hasModel()) {
            $this->querySelector = '#' . $this->options['id'];
        } elseif (empty($this->querySelector)) {
            $this->querySelector = ArrayHelper::remove($this->clientOptions, 'querySelector', '#' . $this->options['id']);
        }
    }
protected function registerPlugin ( ) { if ( ! isset ( $ this -> options [ 'id' ] ) ) { $ this -> options [ 'id' ] = $ this -> hasModel ( ) ? Html :: getInputId ( $ this -> model , $ this -> attribute ) : $ this -> getId ( ) ; } else { $ this -> setId ( $ this -> options [ 'id' ] ) ; } $ clientOptions = [ ] ; $ this -> clientOptions = ArrayHelper :: merge ( $ clientOptions , $ this -> clientOptions ) ; if ( $ this -> hasModel ( ) ) { $ this -> querySelector = '#' . $ this -> options [ 'id' ] ; } elseif ( empty ( $ this -> querySelector ) ) { $ this -> querySelector = ArrayHelper :: remove ( $ this -> clientOptions , 'querySelector' , '#' . $ this -> options [ 'id' ] ) ; } }
Registers switchery plugin
Registers switchery plugin