public function id() : string
    {
        $id = $this->name();
        if ($this->prefix) {
            $id = implode('-', $this->prefix)."-$id";
        }
        $id = preg_replace('/[\W]+/', '-', $id);
        return trim(preg_replace('/[-]+/', '-', $id), '-');
    }
public function id() : string
    {
        $id = $this->name();
        if ($this->prefix) {
            $id = implode('-', $this->prefix)."-$id";
        }
        $id = preg_replace('/[\W]+/', '-', $id);
        return trim(preg_replace('/[-]+/', '-', $id), '-');
    }
public function id ( ) : string { $ id = $ this -> name ( ) ; if ( $ this -> prefix ) { $ id = implode ( '-' , $ this -> prefix ) . "-$id" ; } $ id = preg_replace ( '/[\W]+/' , '-' , $ id ) ; return trim ( preg_replace ( '/[-]+/' , '-' , $ id ) , '-' ) ; }
Returns the ID generated for the element.

@return string
Returns the ID generated for the element .