function drupal_html_class

Prepares a string for use as a valid class name.

Do not pass one string containing multiple classes as they will be incorrectly concatenated with dashes, i.e. "one two" will become "one-two".

Parameters

$class: The class name to clean.

Return value

The cleaned class name.

17 calls to drupal_html_class()
contextual_pre_render_links in drupal/core/modules/contextual/contextual.module
Pre-render callback: Builds a renderable array for contextual links.
dblog_overview in drupal/core/modules/dblog/dblog.admin.inc
Page callback: Displays a listing of database log messages.
drupal_region_class in drupal/core/includes/common.inc
Provides a standard HTML class name that identifies a page region.
drupal_retrieve_form in drupal/core/includes/form.inc
Retrieves the structured array that defines a given form.
field_ui_table_pre_render in drupal/core/modules/field_ui/field_ui.admin.inc
Render API callback: Performs pre-render tasks on field_ui_table elements.

... See full list

File

drupal/core/includes/common.inc, line 3390
Common functions that many Drupal modules will need to reference.

Code

function drupal_html_class($class) {
  return drupal_clean_css_identifier(drupal_strtolower($class));
}