Drupal 7 开发内部培训资料, 分头诗人

关于表单传值

赞成!
0
否决!
$items['admin/aaa/bbb/%']=array(

'page callback'=>'drupal_get_form',

'page arguments'=>array('cc',3),

.......

)

function cc(&$form_state,$id){

$sql=db_select('qq','q')->fields('q')->condition('q.id',$id,'=')->execute()->fetchall();

......

}

 

提示错误 waming:Parameter 1 to cc() expected to be a reference,value given in drupal_retrieve_form()(line 841 of /var/www/html/d7/includes/form.inc).

请教下这是哪里错了嘛?

表单和菜单的传值应该怎么做呢?

1 个回答

赞成!
0
否决!
$items['admin/aaa/bbb/%']=array(
'page callback'=>'bb',
'page arguments'=>array(3),
.......
)

function bb($id){
return drupal_get_form('cc', $id);
}

function cc($form, &$form_state,$id){
$sql=db_select('qq','q')->fields('q')->condition('q.id',$id,'=')->execute()->fetchall();
......
}