This is my hook_menu
:
$items['events/%event'] = array(
'title' => 'Event',
'title callback' => 'entity_label',
'title arguments' => array('event', 1),
'page callback' => 'events_view',
'page arguments' => array(1),
'access callback' => 'entity_access',
'access arguments' => array('view', 'event', 1),
'file' => 'events.pages.inc',
);
return $items;
But when I navigate to events/2
there's a 404 error waiting! Here's the page:
As you can see, my Event
has been successfully created (it exists in database and its id
is definitely 2
) but the requested page could not be found and Shortcuts
menu and Navigation
block has disappeared.
What possibly could I mistaken?
Feel free to ask for more information.
Thanks.
EDIT:
I'm using Drupal 7.12
localhost/shamsi/events/2
and the corresponding uri inhook_menu
would be:events/%event
. Right?