【发布时间】:2011-10-03 17:09:03
【问题描述】:
Drupal 7,$output 在我的页面上显示字符串“Array”,我不知道为什么,这是代码:
它只能这样工作:return drupal_get_form('test_exp_form')
但我需要将 html 和文本添加到我的 $output 变量中,我不能只返回表单。
function test_page() {
$output = '<div>Hello</div>';
$output = drupal_get_form('test_exp_form');
return $output;
}
function test_exp_form($form, &$form_stat) {
$form = array();
$form['example_textfield'] = array(
'#type' => 'textfield',
'#title' => t('Example Textfield'),
'#default_value' => 'some text',
);
return $form;
}
【问题讨论】: