我希望我的模块覆盖由另一个模块设置的路径
例子:
模块 A 注册了一个路径:
$menu['node/%id/test'] = array(
'title' => 'Test',
'page callback' => 'test_A',
'page arguments' => array(1),
'access callback' => 'test_access',
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
)
现在我创建模块 B 并注册相同的路径。
$menu['node/%id/test'] = array(
'title' => 'Test',
'page callback' => 'test_B',
'page arguments' => array(1),
'access callback' => 'test_access',
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
)
对该路径的每个请求
www.mysite.com/node/1/test
将路由到模块 B 而不是 A。
覆盖其他模块设置的现有路径的最佳方法是什么?