Framework  3.9
APIJSONFormatter Class Reference

Standard JSON formatter - formats items as a JSON serialized array of objects. More...

+ Inheritance diagram for APIJSONFormatter:
+ Collaboration diagram for APIJSONFormatter:

Public Member Functions

 format ($items)
 Override this function to provide your format definition. More...
 
- Public Member Functions inherited from APIFormatter
 getClass ()
 

Additional Inherited Members

- Public Attributes inherited from APIFormatter
 $parent
 

Detailed Description

Standard JSON formatter - formats items as a JSON serialized array of objects.

Definition at line 69 of file api_helper.inc.

Member Function Documentation

◆ format()

APIJSONFormatter::format (   $items)

Override this function to provide your format definition.

The results should be sent to the output buffer, via 'echo' or equivalent.

Parameters
array$itemsthe list of DataItems to be formatted

Reimplemented from APIFormatter.

Definition at line 71 of file api_helper.inc.

72  {
73  header("Content-Type: text/json");
74  echo toJSON($items);
75  }
toJSON($items)
Definition: data_item.inc:2102

The documentation for this class was generated from the following file: