Wednesday, 8 January 2014

Creating Drupal 7 Service

  array(
      'title'=>t('bbd_servicehello'),
      'description'=>t('Creating a service'),
      ),
      );
      
 }
 /**
 * Implements hook_services_resources().
 */


function bbd_servicehello_services_resources() {
  $bbd_servicehello = array(
      '#api_version' => 3002,
  );
  $bbd_servicehello = array(
      'bbd_greetings' => array(
          'actions' => array(
              'bbd_say_hello' => array(
                  'help' => '',
                  'callback' => 'say_hello',
                  'args' => array(
                      array(
                          'name' => 'greetings_to',
                          'type' => 'string',
                          'description' => 'greetings',
                          'source' => array('data' => 'greetings_to'),
                          'optional' => FALSE,
                      ),
                  ),
                  'access callback' => 'bbd_servicehello_access_menu',
                  'file' => array('type' => 'module', 'module' => 'bbd_serviceshello', 'name' => 'bbd_serviceshello'),
              ),
               
          ),
      ),
  );
  return $bbd_servicehello;
}


function _bbd_servicehello_services_access_callback() {
  return true;
}


function say_hello($greetings_to){
  return array($greetings_to);
}

] 

No comments:

Post a Comment