drupal_attributes

  1. drupal
    1. 4.7
    2. 5
    3. 6 common.inc
    4. 7 common.inc
Versions
4.7 – 6 drupal_attributes($attributes = array())
7 drupal_attributes(array $attributes = array())

Format an attribute string to insert in a tag.

Parameters

$attributes An associative array of HTML attributes.

Return value

An HTML string ready for insertion in a tag.

Related topics

▾ 16 functions call drupal_attributes()

drupal_add_link in includes/common.inc
Add a <link> tag to the page's HEAD.
format_xml_elements in includes/common.inc
Format XML elements.
l in includes/common.inc
Format an internal Drupal link.
theme_button in includes/form.inc
theme_checkbox in includes/form.inc
Format a checkbox.
theme_fieldset in includes/form.inc
Format a group of form items.
theme_file in includes/form.inc
Format a file upload field.
theme_form in includes/form.inc
Format a form.
theme_hidden in includes/form.inc
Format a hidden form field.
theme_image in includes/theme.inc
Return a themed image.
theme_password in includes/form.inc
Format a password field. *
theme_radio in includes/form.inc
Format a radio button.
theme_select in includes/form.inc
Format a dropdown menu or scrolling selection box.
theme_table in includes/theme.inc
Return a themed table.
theme_textarea in includes/form.inc
Format a textarea.
theme_textfield in includes/form.inc
Format a textfield.

Code

includes/common.inc, line 1077

<?php
function drupal_attributes($attributes = array()) {
  if (is_array($attributes)) {
    $t = '';
    foreach ($attributes as $key => $value) {
      $t .= " $key=" . '"' . check_plain($value) . '"';
    }
    return $t;
  }
}
?>