protected function registerPlugin($name)
    {
        $view = $this->getView();
        SemanticUiPluginAsset::register($view);
        $selector = $this->selector ? : '#' . $this->options['id'];
        if ($this->clientOptions !== false) {
            $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions);
            $js = "jQuery('$selector').$name($options);";
            $view->registerJs($js);
        }
        if (!empty($this->clientEvents)) {
            $js = [];
            foreach ($this->clientEvents as $event => $handler) {
                $handler = $handler instanceof JsExpression ? $handler : new JsExpression($handler);
                $js[] = "jQuery('$selector').$name('setting', '$event', $handler);";
            }
            $view->registerJs(implode("\n", $js));
        }
    }