/** * Function to set the attribute of a form element * * @param $key The name of the attribute * @param $val The value of the attribute */ function setAttribute($key, $val) { // 'id' is a very special attribute ( in xhtml it cannot have special characters ) if ($key == 'id') { $val = YDStringUtil::convertToSafe(strtolower($val)); } $this->_attributes[$key] = $val; }