/** * Renders the widget. */ public function run() { MaterializeAsset::register($this->getView()); $this->registerClientEvents(); $this->getView()->registerJs("\n\$('#{$this->id}-btn').dropdown({\n inDuration: 300,\n outDuration: 225,\n constrain_width: false, // Does not change width of dropdown to that of the activator\n hover: false, // Activate on click\n alignment: 'left', // Aligns dropdown to left or right edge (works with constrain_width)\n gutter: 0, // Spacing from edge\n belowOrigin: false // Displays dropdown below the button\n});\n "); if ($this->buttonLabel !== null) { return Html::tag($this->buttontagName, $this->buttonLabel, $this->buttonOptions) . $this->renderItems($this->items, $this->options); } else { return $this->renderItems($this->items, $this->options); } }
/** * Registers a specific Materialize plugin and the related events * @param string $name the name of the Materialize plugin */ protected function registerPlugin($name) { $view = $this->getView(); MaterializeAsset::register($view); $id = $this->options['id']; if ($this->clientOptions !== false) { $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions); $js = "jQuery('#{$id}').{$name}({$options});"; $view->registerJs($js); } $this->registerClientEvents(); }
/** * Renders the widget. */ public function run() { MaterializeAsset::register($this->getView()); if ($this->buttonCollapse) { MaterializeAsset::register($this->getView()); $this->getView()->registerJs('$("#' . $this->id . '-button-collapse").sideNav();'); } return $this->renderItems() . $this->renderMobileMenuItems(); }
/** * Renders the widget. */ public function run() { MaterializeAsset::register($this->getView()); return Html::tag($this->tagName, $this->renderItems(), $this->options); }
/** * Renders the widget. */ public function run() { $tag = ArrayHelper::remove($this->options, 'tag', 'nav'); echo Html::endTag($tag, $this->options); if ($this->fixed) { echo Html::endTag('div'); } MaterializeAsset::register($this->getView()); }
/** * Renders the widget. */ public function run() { MaterializeAsset::register($this->getView()); return Html::tag('div', Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options) . Html::tag('ul', $this->renderButtons()), $this->wrapOptions); }