public function getId()
    {
        $id = $this->props['attribs']['id'];
        $sepChar = '_'; // character to join prefix and id
        $repChar = '_'; // replace \W with this char
        if (!$id && $this->props['attribs']['name']) {
            $id = \preg_replace('/\W/', $repChar, $this->props['attribs']['name']);
            $id = \preg_replace('/'.$repChar.'+/', $repChar, $id);
            $id = \trim($id, $repChar);
            if ($id && $this->props['idPrefix']) {
                $prefix = $this->props['idPrefix'];
                if (\preg_match('/[a-z]$/i', $prefix)) {
                    $prefix = $prefix.$sepChar;
                }
                $id = $prefix.$id;
            }
            if ($id) {
                $this->props['attribs']['id'] = $id;
            }
        }
        return $id;
    }
public function getId()
    {
        $id = $this->props['attribs']['id'];
        $sepChar = '_'; // character to join prefix and id
        $repChar = '_'; // replace \W with this char
        if (!$id && $this->props['attribs']['name']) {
            $id = \preg_replace('/\W/', $repChar, $this->props['attribs']['name']);
            $id = \preg_replace('/'.$repChar.'+/', $repChar, $id);
            $id = \trim($id, $repChar);
            if ($id && $this->props['idPrefix']) {
                $prefix = $this->props['idPrefix'];
                if (\preg_match('/[a-z]$/i', $prefix)) {
                    $prefix = $prefix.$sepChar;
                }
                $id = $prefix.$id;
            }
            if ($id) {
                $this->props['attribs']['id'] = $id;
            }
        }
        return $id;
    }
public function getId ( ) { $ id = $ this -> props [ 'attribs' ] [ 'id' ] ; $ sepChar = '_' ; // character to join prefix and id $ repChar = '_' ; // replace \W with this char if ( ! $ id && $ this -> props [ 'attribs' ] [ 'name' ] ) { $ id = \ preg_replace ( '/\W/' , $ repChar , $ this -> props [ 'attribs' ] [ 'name' ] ) ; $ id = \ preg_replace ( '/' . $ repChar . '+/' , $ repChar , $ id ) ; $ id = \ trim ( $ id , $ repChar ) ; if ( $ id && $ this -> props [ 'idPrefix' ] ) { $ prefix = $ this -> props [ 'idPrefix' ] ; if ( \ preg_match ( '/[a-z]$/i' , $ prefix ) ) { $ prefix = $ prefix . $ sepChar ; } $ id = $ prefix . $ id ; } if ( $ id ) { $ this -> props [ 'attribs' ] [ 'id' ] = $ id ; } } return $ id ; }
Returns ID attribute
If ID attribute is non-existant, ID will be derived from name and prefix

@return string|null
Returns ID attribute If ID attribute is non - existant ID will be derived from name and prefix