我正在开发 Drupal 7 的模块。我定义了一个名为“Booth”的节点类型。现在在我的模块中,我创建了一个包含姓名、电话、地址等字段的表单。这些字段之一是 Booth,它是一个 Select 类型元素。我想将展位标题(我在“添加内容 > 展位”中添加)作为我的选择元素选项。我怎样才能做到这一点?如何使用展位内容类型的标题字段填充选项数组?[请看下图]
$form['exbooth'] = array(
'#type' => 'select',
'#title' => t('Exhibition Booth'),
'#options' => array(), // I want to fill this array with title fields of booth content type
'#required' => TRUE,
);
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#required' => TRUE,
);
$form['lastname'] = array(
'#type' => 'textfield',
'#title' => t('Last Name'),
'#required' => TRUE,