You are here

public function FormatterHalJson::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

1 method overrides FormatterHalJson::render()
FormatterHalXml::render in modules/restful_example/src/Plugin/formatter/FormatterHalXml.php
Renders an array in the selected format.

File

src/Plugin/formatter/FormatterHalJson.php, line 233
Contains \Drupal\restful\Plugin\formatter\FormatterHalJson.

Class

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

Namespace

Drupal\restful\Plugin\formatter

Code

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