drupal menu callback hook not calling function -
i using drupal 7. have link goes href="/mod/filter/1"
<a href="/mod/filter/1">x</a> and have a hook_menu
function mod_menu () { $menu = array( 'mod/filter/%' => array ( "title" => "bare html use in ajax.", "page callback" => "mod_remove_filter_function", "page arguments" => array(1), "type" => menu_callback, ) ); return $menu; } then callback function
function mod_remove_filter_function($arg){ dsm('call filter'); drupal_goto('/res/search'); } to me should work, first time i've used menu hook looks should work according documentation given.
any ideas why doesn't work?
function mod_menu () { $menu = array( 'mod/filter/%' => array ( "title" => "bare html use in ajax.", "page callback" => "mod_remove_filter_function", "page arguments" => array(1), "type" => menu_callback, ) ); return $menu; } hook workds perfect. problem might in callback function dsm function requires devel module , if using drupal_goto('/res/search'); check "/res/search" path first .
:) here how use hook_menu in custom modules.
$menu['mod/filter/%'] = array( 'title'=>t('look title'), 'page callback' => 'mod_remove_filter_function', 'access callback' => 'user_access', 'access arguments' => array('access_contents'), 'type' => menu_normal_item, );
Comments
Post a Comment