【发布时间】:2012-04-21 14:35:20
【问题描述】:
Drupal 没有在我的模块中为我的表单调用我的主题函数。
我在 .module 文件中添加了 hook_theme,如下所示:
function agil_theme() {
return array(
'agil_list_form' => array(
'render element' => 'form',
),
);
}
在哪里:
- agil 是我的模块的名称(不是我的主题)
- agil_list_form 是我的表单声明的名称(带有默认主题的 chich 渲染)
我想调用一个函数来创建我自己的标记,就像这个:
function theme_agil_list_form($form) {
$output = "<table><th><td></td><td>".t('Title')."</td><td>".t('Link')."</td></th>";
$output .= "<tr><td>";
$output .= drupal_render($form['name']);
...
但是 Drupal 从来没有调用过这个函数...我清除了缓存但是什么也没...
我错过了什么?
我还阅读了有关 Drupal 7 中新主题声明的内容: http://drupal.org/update/modules/6/7#hook_theme_render_changes
【问题讨论】: