theme_radios

5 form.inc theme_radios($element)
6 form.inc theme_radios($element)
7 form.inc theme_radios($variables)
8 form.inc theme_radios($variables)

Format a set of radio buttons.

Parameters

$element: An associative array containing the properties of the element. Properties used: title, value, options, description, required and attributes.

Return value

A themed HTML string representing the radio button set.

Related topics

File

includes/form.inc, line 1579

Code

function theme_radios($element) {
  $class = 'form-radios';
  if (isset($element['#attributes']['class'])) {
    $class .= ' ' . $element['#attributes']['class'];
  }
  $element['#children'] = '<div class="' . $class . '">' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
  if ($element['#title'] || $element['#description']) {
    unset($element['#id']);
    return theme('form_element', $element, $element['#children']);
  }
  else {
    return $element['#children'];
  }
}

Comments

I have customised this

I have customised this function in a custom module along with hook_theme and hook_elements. My custom form element uses this function to render its output, but I have no children! I have the styles, but there ARE NO RADIO BUTTONS rendered.

Help!

You have to use theme_radio &

You have to use theme_radio & theme_radios together to get the result out of it. The below article might be helpful for you.
http://www.encodez.com/blog/how-to-theme-radio-drupal.html

Login or register to post comments