original_string: 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, '-');
      }
code: 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, '-');
      }
code_tokens: 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 , '-' ) ; }
docstring: 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.
docstring_tokens: Generate an ID attribute for an element .