function drupal_attributes
7.x common.inc | drupal_attributes(array $attributes = array()) |
6.x common.inc | drupal_attributes($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.
23 calls to drupal_attributes()
- drupal_add_link in drupal-6.x/
includes/ common.inc - Add a <link> tag to the page's HEAD.
- format_xml_elements in drupal-6.x/
includes/ common.inc - Format XML elements.
- l in drupal-6.x/
includes/ common.inc - Formats an internal or external URL link as an HTML anchor tag.
- node_feed in drupal-6.x/
modules/ node/ node.module - A generic function for generating RSS feeds from a set of nodes.
- template_preprocess_user_profile_category in drupal-6.x/
modules/ user/ user.pages.inc - Process variables for user-profile-category.tpl.php.
File
- drupal-6.x/
includes/ common.inc, line 1581 - Common functions that many Drupal modules will need to reference.
Code
function drupal_attributes($attributes = array()) {
if (is_array($attributes)) {
$t = '';
foreach ($attributes as $key => $value) {
$t .= " $key=" . '"' . check_plain($value) . '"';
}
return $t;
}
}