macgyer\yii2materializecss\widgets\Modal::init PHP Method

init() public method

Initializes the widget.
public init ( )
    public function init()
    {
        parent::init();
        $this->initDefaults();
        $options = $this->options;
        $html = $this->renderToggleButton();
        $tag = ArrayHelper::remove($options, 'tag', 'div');
        $html .= Html::beginTag($tag, $options);
        if ($this->closeButtonPosition === self::CLOSE_BUTTON_POSITION_PRECEDE_CONTENT_CONTAINER) {
            $html .= $this->renderCloseButton();
        }
        $html .= Html::beginTag('div', ['class' => 'modal-content']);
        if ($this->closeButtonPosition === self::CLOSE_BUTTON_POSITION_BEFORE_CONTENT) {
            $html .= $this->renderCloseButton();
        }
        echo $html;
        $this->registerPlugin('leanModal', '.modal-trigger');
    }