drupal_html_class

Versions
7
drupal_html_class($class)

Prepare 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.

▾ 7 functions call drupal_html_class()

drupal_region_class in includes/common.inc
Provides a standard HTML class name that identifies a page region.
field_default_form in modules/field/field.form.inc
Create a separate form element for each field.
field_multiple_value_form in modules/field/field.form.inc
Special handling to create form elements for multiple values.
system_build_contextual_links in modules/system/system.module
Build a renderable array for contextual links.
template_preprocess_block in modules/block/block.module
Process variables for block.tpl.php
template_preprocess_html in includes/theme.inc
Preprocess variables for html.tpl.php
template_preprocess_node in modules/node/node.module
Process variables for node.tpl.php

Code

includes/common.inc, line 3552

<?php
function drupal_html_class($class) {
  return drupal_clean_css_identifier(drupal_strtolower($class));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.