Skip to content

Instantly share code, notes, and snippets.

@cam8001
Created November 30, 2012 16:05
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 cam8001/4176661 to your computer and use it in GitHub Desktop.
Save cam8001/4176661 to your computer and use it in GitHub Desktop.
hook_menu_example
<?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