/** * Registers a specific Bootstrap plugin and the related events * @param string $name the name of the Bootstrap plugin */ protected function registerPlugin($name) { $view = $this->getView(); BootstrapPluginAsset::register($view); $id = $this->options['id']; if ($this->clientOptions !== false) { $options = empty($this->clientOptions) ? '' : Json::htmlEncode($this->clientOptions); $js = "jQuery('#{$id}').{$name}({$options});"; $view->registerJs($js); } $this->registerClientEvents(); }
/** * Renders the widget. */ public function run() { BootstrapPluginAsset::register($this->getView()); $this->registerClientEvents(); return $this->renderItems($this->items, $this->options); }
/** * Renders the widget. */ public function run() { $tag = ArrayHelper::remove($this->containerOptions, 'tag', 'div'); echo Html::endTag($tag); if ($this->renderInnerContainer) { echo Html::endTag('div'); } $tag = ArrayHelper::remove($this->options, 'tag', 'nav'); echo Html::endTag($tag, $this->options); BootstrapPluginAsset::register($this->getView()); }