dbtng_example_menu

7 dbtng_example.module dbtng_example_menu()
8 dbtng_example.module dbtng_example_menu()

Implements hook_menu().

Set up calls to drupal_get_form() for all our example cases.

Related topics

File

dbtng_example/dbtng_example.module, line 355
This is an example outlining how a module can make use of the new DBTNG database API in Drupal 7.

Code

function dbtng_example_menu() {
  $items = array();

  $items['examples/dbtng'] = array(
    'title' => 'DBTNG Example', 
    'page callback' => 'dbtng_example_list', 
    'access callback' => TRUE,
  );
  $items['examples/dbtng/list'] = array(
    'title' => 'List', 
    'type' => MENU_DEFAULT_LOCAL_TASK, 
    'weight' => -10,
  );
  $items['examples/dbtng/add'] = array(
    'title' => 'Add entry', 
    'page callback' => 'drupal_get_form', 
    'page arguments' => array('dbtng_example_form_add'), 
    'access callback' => TRUE, 
    'type' => MENU_LOCAL_TASK, 
    'weight' => -9,
  );
  $items['examples/dbtng/update'] = array(
    'title' => 'Update entry', 
    'page callback' => 'drupal_get_form', 
    'page arguments' => array('dbtng_example_form_update'), 
    'type' => MENU_LOCAL_TASK, 
    'access callback' => TRUE, 
    'weight' => -5,
  );
  $items['examples/dbtng/advanced'] = array(
    'title' => 'Advanced list', 
    'page callback' => 'dbtng_example_advanced_list', 
    'access callback' => TRUE, 
    'type' => MENU_LOCAL_TASK,
  );

  return $items;
}
Login or register to post comments