1 dbtng_example.module dbtng_example_menu()

Implements hook_menu().

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

Related topics

File

modules/examples/dbtng_example/dbtng_example.module, line 322
This is an example outlining how a module can make use of the DBTNG database API in Backdrop.

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' => 'backdrop_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' => 'backdrop_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;
}