You are here

public function FormatterJsonApi::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/FormatterJsonApi.php, line 240
Contains \Drupal\restful\Plugin\formatter\FormatterJsonApi.

Class

FormatterJsonApi
Class FormatterJsonApi @package Drupal\restful\Plugin\formatter

Namespace

Drupal\restful\Plugin\formatter

Code

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