コード例 #1
0
 /**
  * @param string $name the name of the Materialize plugin
  */
 protected function registerPlugin($name)
 {
     $view = $this->getView();
     MaterializePluginAsset::register($view);
     if ($this->clientOptions !== false && is_array($this->clientOptions)) {
         $options = empty($this->clientOptions) ? '' : Json::htmlEncode($this->clientOptions);
         $js = "Materialize.{$name}.apply(null, {$options});";
         $view->registerJs($js);
     }
 }
コード例 #2
0
 /**
  * Renders the widget.
  */
 public function run()
 {
     MaterializePluginAsset::register($this->getView());
     $this->registerClientEvents();
     return $this->renderItems($this->items, $this->options);
 }