You are here

public function FormatterJson::render in RESTful 7.2

Renders an array in the selected format.

Parameters

array $structured_data: The data prepared to be rendered as returned by \RestfulFormatterInterface::prepare().

Return value

string The body contents for the HTTP response.

Overrides FormatterInterface::render

File

src/Plugin/formatter/FormatterJson.php, line 195
Contains \Drupal\restful\Plugin\formatter\FormatterJson.

Class

FormatterJson
Class FormatterHalJson.

Namespace

Drupal\restful\Plugin\formatter

Code

public function render(array $structured_data) {
  return drupal_json_encode($structured_data);
}