BaseWidgetTrait.php
protected function registerMaterializePlugin($name)
    {
        $view = $this->getView();
        if ($this->materializeAsset) {
            MaterializeAsset::register($view);
        }
        if ($this->customAsset) {
            MaterializeCustomAsset::register($view);
        }

        $id = $this->options['id'];

        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);
        }

        $this->registerClientEvents();
    }
protected function registerMaterializePlugin($name)
    {
        $view = $this->getView();
        if ($this->materializeAsset) {
            MaterializeAsset::register($view);
        }
        if ($this->customAsset) {
            MaterializeCustomAsset::register($view);
        }

        $id = $this->options['id'];

        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);
        }

        $this->registerClientEvents();
    }
Registers a specific Materialize plugin and the related events
@param string $name the name of the Materialize plugin