我有一个 drupal 网站,我想在其中添加一个新 URL。这个菜单有两个参数,应该从客户端传递。
function campaign_management_menu() {
$items = array();
$items['campaign-management/test/%/%'] = array(
'title' => 'Campaign Management',
'description' => 'A section where you can manage your campaigns',
'page callback' => 'cm_home',
'page arguments' => array(3, 4),
'access callback' => TRUE,
);
return $items
}
在这里,对于第四个参数,应该只有两个选项 {add/edit}。drupal 中是否有任何选项可以明确设置这两个关键字。IE,
$items['campaign-management/test/%/{add|edit}'] = array(
'title' => 'Campaign Management',
'description' => 'A section where you can manage your campaigns',
'page callback' => 'cm_home',
'page arguments' => array(3, 4),
'access callback' => TRUE,
);