【发布时间】:2011-11-28 09:14:35
【问题描述】:
我正在重构一些代码是我在某个时代编写的 Drupal 模块。为了方便其他人使用,我添加了一个配置页面。
我已经成功定义了一个字段集,但我不知道如何向其中“插入”内容。 以下代码为我网站上定义的每种节点类型设置无线电:
$node_types = node_get_types('names');
$test = array(
'#title' => t('tweeting node'),
'#type' => 'radios',
'#options' => $node_types,
'#default_value' => 'Page',
'#weight' => 0,
);
以下定义了我想要插入上面生成的单选按钮的字段集:
$form['twitterhelper_nodecollection'] = array(
'#type' => 'fieldset',
'#title' => t('select a node'),
'#weight' => 0,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#parents' => $test,
);
【问题讨论】: