문제

Drupal 7

function custom_menu() {
    $items['node_update/%nid/%pic/%name'] = array (
        'title' => 'Redirecting to your profile page',
        'page callback' => custom_node_update,
        'page arguments' => array(3,4,5),
        'access callback' => TRUE,
        'type' => MENU_CALLBACK,
    );    
    return $items;
}

When i use http://myserver.com/node_update/51/sites%2fdefault%2fimages/picture.jpg/admin

so when im using %2f hook_menu somewhat still consider it as forward slash '/' therefore it somewhat recognised as this instead http://myserver.com/node_update/51/sites/default/images/picture.jpg/admin which is of course beyond the arguments i'm listening on hook_menu.

Anyone can help on this please. how to use url_encoded string as argument.

도움이 되었습니까?

해결책

Your page arguments are not set correctly. Try to change it to be:

'page arguments' => array(1, 2, 3),

Then flash the website cache and try again.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top