Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- privacy":{"value":"1"},
- "privacy":[]
- For Private : privacy":{"value":"1"},
- For Public : privacy":{"value":"0"},
- function my_module_services_request_postprocess_alter($controller, $args, &$result) {
- // In my response, I include the request string in the '_links' array.
- // I can use this now to determine which resource was requested.
- if (strpos($result->_links['self']['href'], 'api/1.0/widget')) {
- // Now I know I'm dealing with a widget request, so I'll
- // add the random string here...
- $result->String = "This is a string that I'm adding to the widget response";
- }
- }
- Array (
- [_links] => Array (
- [self] => Array (
- [href] => /api/1.0/widget/12345
- )
- )
- [count] => 1
- [_embedded] => Array (
- [0] => Array (
- [id] => 12345
- [type] => widget
- [path] => /node/157601
- )
- )
- [String] => 'This is a string that I'm adding to the widget response'
- )
Add Comment
Please, Sign In to add comment