Created
November 30, 2012 16:05
-
-
Save cam8001/4176661 to your computer and use it in GitHub Desktop.
hook_menu_example
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
<?php | |
/** | |
* Implements hook_menu(). | |
*/ | |
function mymodule_menu() { | |
$items['user/%user/bb_licenses/%'] = array( | |
'title' => 'Saludar', | |
'page callback' => 'gestionar_licencia', | |
'page arguments' => array(1,3), | |
'type' => MENU_CALLBACK, | |
'access callback' => user_access('my permission'), | |
); | |
return $items; | |
} | |
/** | |
* Do a thing. | |
* | |
* @param object $user | |
* Fully loaded user object. | |
* @param $argument | |
* Some argument. | |
* | |
* @see mymodule_menu() | |
* @see user_load() | |
*/ | |
function gestionar_licensia($user, $argument) { | |
return t('This is my argument: @argument', array('@argument' => $argument)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment