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

init() public method

Initializes the widget.
public init ( )
    public function init()
    {
        parent::init();
        if (!$this->name) {
            throw new InvalidConfigException('The icon name must be specified.');
        }
        if ($this->position === null) {
            $this->position = 'left';
        }
        Html::addCssClass($this->options, ['material-icons', $this->position]);
    }