protected function _id($name, $val)
    {
        $name = $this->_domId($name);

        $idSuffix = mb_strtolower(str_replace(['/', '@', '<', '>', ' ', '"', '\''], '-', $val));
        $count = 1;
        $check = $idSuffix;
        while (in_array($check, $this->_idSuffixes)) {
            $check = $idSuffix . $count++;
        }
        $this->_idSuffixes[] = $check;

        return trim($name . '-' . $check, '-');
    }
protected function _id($name, $val)
    {
        $name = $this->_domId($name);

        $idSuffix = mb_strtolower(str_replace(['/', '@', '<', '>', ' ', '"', '\''], '-', $val));
        $count = 1;
        $check = $idSuffix;
        while (in_array($check, $this->_idSuffixes)) {
            $check = $idSuffix . $count++;
        }
        $this->_idSuffixes[] = $check;

        return trim($name . '-' . $check, '-');
    }
protected function _id ( $ name , $ val ) { $ name = $ this -> _domId ( $ name ) ; $ idSuffix = mb_strtolower ( str_replace ( [ '/' , '@' , '<' , '>' , ' ' , '"' , '\'' ] , '-' , $ val ) ) ; $ count = 1 ; $ check = $ idSuffix ; while ( in_array ( $ check , $ this -> _idSuffixes ) ) { $ check = $ idSuffix . $ count ++ ; } $ this -> _idSuffixes [ ] = $ check ; return trim ( $ name . '-' . $ check , '-' ) ; }
Generate an ID attribute for an element.

Ensures that id's for a given set of fields are unique.

@param string $name The ID attribute name.
@param string $val The ID attribute value.
@return string Generated id.
Generate an ID attribute for an element .