I have a form that I'm trying to style the output of the radio buttons. Currently, I have a form element:
$form['branding_color_radios'] = array(
'#type' => 'radios',
'#states' => array(
'visible' => array(
':input[name="use_theme_defaults"]' => array('checked' => FALSE),
),
),
'#title' => t('Color Radios'),
'#options' => $options,
'#default_value' => variable_get('branding_color_set', 'ocac_1'),
'#theme' => 'colorset_radios',
);
With $options array being:
Array ( [1] => red [2] => blue [3] => green [4] => black )
And that should call the appropriate theme_colorradios and theme_colorradio, however, it fails with this error:
Notice: Undefined index: #options in theme_colorradios().
Warning: array_keys() [function.array-keys]: The first argument should be an array in theme_colorradios().
Notice: Undefined index: in theme_colorradios().
Warning: Invalid argument supplied for foreach() in theme_colorradios().
Here's my hook_theme:
/*
* Implementation of hook_theme().
*/
function mymodule_theme($existing, $type, $theme, $path) {
return array(
// Theme for radio group
'colorradios' => array(
'variables' => array('element' => NULL),
),
// Theme for single radio
'colorradio' => array(