public function registerPlugin() { $settings = false; $view = $this->getView(); UIAsset::register($view); if ($this->enableTableSort) { $settings = true; TableSortAsset::register($view); } $js = "ui.semantic.initTableSort({$settings});"; $view->registerJs($js); }
public function renderToggleButton() { $tag = ArrayHelper::remove($this->toggleButton, 'tag', 'div'); $label = ArrayHelper::remove($this->toggleButton, 'label', Html::tag('i', '', ['class' => 'content icon'])); UI::addCssClasses($this->toggleButton, ['ui', $this->buttonIcon, 'icon', 'button', 'fixed', 'attached']); if ($this->position === static::POS_LEFT) { $position = static::POS_RIGHT; } else { $position = static::POS_LEFT; } UI::addCssClasses($this->toggleButton, [$position]); $view = $this->getView(); UIAsset::register($view); $view->registerJs("ui.semantic.init();"); return Html::tag($tag, $label, $this->toggleButton); }
public function registerJs() { $view = $this->getView(); UIAsset::register($view); $id = $this->getId(); $js = "ui.semantic.initTabs('#" . $this->getId() . "');"; $view->registerJs($js); }
protected function renderToggleButton() { if ($this->toggleButton !== false) { $tag = ArrayHelper::remove($this->toggleButton, 'tag', 'div'); $label = ArrayHelper::remove($this->toggleButton, 'label', 'Show'); if ($tag === 'button' && !isset($this->toggleButton['type'])) { $this->toggleButton['type'] = 'button'; } if ($tag === 'div') { UI::addCssClasses($this->toggleButton, ['ui', 'button']); } $view = $this->getView(); UIAsset::register($view); $view->registerJs('ui.semantic.init();'); return Html::tag($tag, $label, $this->toggleButton); } else { return null; } }
public function renderCloseButton() { $view = $this->getView(); UIAsset::register($view); $options['id'] = $this->getId() . '-close-button'; $js = "ui.semantic.initMessageCloseButtons('#" . $options['id'] . "','{$this->closeTransition}');"; $view->registerJs($js); return UI::i('close', $options); }