欢迎各位兄弟 发布技术文章
这里的技术是共享的
$manager_form = drupal_get_form('manager_form',$gh); //这是额外的参数
// $output .= "<input type='text' name='manager' placeholder='请输入工号或姓名,会自动弹出信息' size='30'/>";
$output .= drupal_render($manager_form);//这里是渲染
//这里第三个参数 $person_gh 才是上面 调用处 $gh 传来的值
function manager_form($form, &$form_state,$person_gh)
{
$form['manager_user'] = array(
'#type' => 'textfield',
'#title' => t('主管信息'),
'#size' => 60,
'#autocomplete_path' => 'manager_user_autocomplete',
'#attributes' => array('class' => array('manager-user-autocomplete')),
);
$form['person_gh'] = array('#type' => 'hidden', '#value' =>$person_gh);
return $form;
}