You are here

public function Formatter::format in RESTful 7.2

Formats the un-structured data into the output format.

Parameters

array $data: The raw data to return.

Return value

string The body contents for the HTTP response.

Overrides FormatterInterface::format

See also

\RestfulFormatterInterface::prepare()

\RestfulFormatterInterface::render()

File

src/Plugin/formatter/Formatter.php, line 46
Contains \Drupal\restful\Plugin\formatter\Formatter

Class

Formatter
Class Formatter.

Namespace

Drupal\restful\Plugin\formatter

Code

public function format(array $data) {
  return $this
    ->render($this
    ->prepare($data));
}