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

init() public method

Initializes the widget.
public init ( )
    public function init()
    {
        parent::init();
        Html::addCssClass($this->options, ['widget' => 'preloader-wrapper active']);
        Html::addCssClass($this->spinnerOptions, ['spinner' => 'spinner-layer']);
        switch ($this->size) {
            case self::SIZE_SMALL:
                Html::addCssClass($this->options, ['spinner-size' => 'small']);
                break;
            case self::SIZE_BIG:
                Html::addCssClass($this->options, ['spinner-size' => 'big']);
                break;
        }
        if ($this->flashColors === false && $this->color) {
            $color = ArrayHelper::getValue($this->colors, $this->color);
            Html::addCssClass($this->spinnerOptions, ['spinner-color' => "spinner-{$color}-only"]);
        }
    }