2011-08-18 73 views
0

我想给我们的主题钩一些复选框的样式。我已经使用form_alter钩子对每个复选框的标签进行了一些更改,现在我想与复选框主题函数进行交互来设置标签的样式。drupal主题复选框

在形式阵列,它说

#theme (String, 20 characters) select_as_checkboxes 

这是我需要重写功能?我该怎么做? 我试过的东西一样

function mymodule_select_as_checkboxes() 

,但我不能让它的工作

回答

0

解决方案:

function my_module_theme_registry_alter(&$theme_registry) { 
     // Register theme_function to use the module custom function 
     if (!empty($theme_registry['select_as_checkboxes'])) { 
     $theme_registry['select_as_checkboxes']['function'] = 'my_module_select_as_checkboxes'; 
     } 
    } 

然后在功能my_module_select_as_checkboxes创建自己的功能或修改原来的一个。