Created
August 10, 2012 00:04
-
-
Save gregmercer/3309318 to your computer and use it in GitHub Desktop.
Drupal: hook_menu example to create a page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_menu(). | |
*/ | |
function <replace with module name>_menu() { | |
$items['path1/path2'] = array( | |
'title' => 'some text for the title', | |
'description' => 'some text for the description', | |
'page callback' => '<replace with module name>_page', | |
'page arguments' => array(1), | |
'access arguments' => array('access content'), | |
); | |
return $items; | |
} | |
/** | |
* Menu callback. | |
* Creates a page in drupal with the path 'path1/path2' | |
*/ | |
function <replace with module name>_page($some_arg) { | |
$output = t('some text for the page'); | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment