You are here

function shurly_service_output in ShURLy 8

Same name and namespace in other branches
  1. 6 shurly_service/shurly_service.inc \shurly_service_output()
  2. 7 shurly_service/shurly_service.inc \shurly_service_output()

Output data in a given format.

4 calls to shurly_service_output()
DefaultController::shurly_service_expand in shurly_service/src/Controller/DefaultController.php
DefaultController::shurly_service_shorten in shurly_service/src/Controller/DefaultController.php
shurly_service_expand in shurly_service/shurly_service.inc
Callback for shurly/api/shorten.
shurly_service_shorten in shurly_service/shurly_service.inc
Callback for shurly/api/shorten.

File

shurly_service/shurly_service.inc, line 91
Link general search functionalities to services module.

Code

function shurly_service_output($data, $input) {
  $format = $input['format'] ? $input['format'] : 'json';
  if (function_exists('shurly_service_output_' . $format)) {
    call_user_func('shurly_service_output_' . $format, $data, $input);
  }
  else {
    print t('invalid format request');
  }
}