Skip to content

Instantly share code, notes, and snippets.

@Soraph
Created October 10, 2013 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Soraph/6919007 to your computer and use it in GitHub Desktop.
Save Soraph/6919007 to your computer and use it in GitHub Desktop.
Example for Tushar
function my_menu() {
$items['path/page'] = array(
'title' => t('Page title'),
'page callback' => 'mypage_callback_function',
'page arguments' => array('my','totally','optional','argumet','list'),
);
return $items;
}
// All your other module logic
function mypage_callback_function($one, $two, $three, $four, $five) {
//When the path "path/page" is requested the page callback function will
//use the 'page arguments' as arguments.
//Special care should be taken for the page callback drupal_get_form(),
//because your specific form callback function will always receive $form
//and &$form_state as the first function arguments.
//Vital information available here
// https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu/7
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment