You are here

function xmlrpc_example_menu in Examples for Developers 6

Same name and namespace in other branches
  1. 7 xmlrpc_example/xmlrpc_example.module \xmlrpc_example_menu()

Implementation of hook_menu(). Register all the demonstration forms.

Related topics

File

xmlrpc_example/xmlrpc_example.module, line 50
This is an example of how to implement an XML-RPC server by registering callbacks to specific methods and how to make xmlrpc calls using the builtin xmlrpc() factory provided by Drupal.

Code

function xmlrpc_example_menu() {

  // This is the server form menu entry. This form can be used to configure
  // some options of the exposed services.
  $items['examples/xmlrpc_server'] = array(
    'title' => 'XMLRPC Server',
    'description' => 'Demonstrates server side XMLRPC with Drupal',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'xmlrpc_example_server_form',
    ),
    'access callback' => TRUE,
    'weight' => 0,
  );

  // This is the client form menu entry.
  $items['examples/xmlrpc_client'] = array(
    'title' => 'XMLRPC Client',
    'description' => 'Demonstrates client side XMLRPC with Drupal',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'xmlrpc_example_client_form',
    ),
    'access callback' => TRUE,
    'weight' => 1,
  );
  return $items;
}