src/Base/Widget.php
public function getId($autoGenerate = true)
    {
        if ($autoGenerate && $this->_id === null) {
            $this->_id = static::$autoIdPrefix . $this->htmlHlp->counter++;
        }

        return $this->_id;
    }
public function getId($autoGenerate = true)
    {
        if ($autoGenerate && $this->_id === null) {
            $this->_id = static::$autoIdPrefix . $this->htmlHlp->counter++;
        }

        return $this->_id;
    }
Returns the ID of the widget.
@param bool $autoGenerate whether to generate an ID if it is not set previously
@return string ID of the widget.