【发布时间】:2011-09-13 15:52:42
【问题描述】:
我在下面有这个菜单挂钩,我通过它向函数发送两个参数。
但在函数中我只接收第一个参数。
有人知道如何使用 Drupal 菜单系统发送和获取多个参数吗?
function drupal_menu(){
$items = array();
$items['drupal/%/%'] = array(
'title' => t('Welcome to the Hello World Module'),
'page callback' => 'drupal_page',
'page arguments' => array(1,2),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
function drupal_page($arg1, $arg2) {
return drupal_json(array('mess1'=>$arg1,'mess2'=>$arg2));
}
【问题讨论】:
-
我遇到了同样的问题,刷新缓存后,它工作了。
标签: php drupal drupal-6 drupal-7