You are here

public function RestfulBase::formatterNames in RESTful 7

Returns the names of the available formatter plugins.

Return value

array Array of formatter names.

1 call to RestfulBase::formatterNames()
RestfulBase::options in plugins/restful/RestfulBase.php
Call resource using the OPTIONS http method.

File

plugins/restful/RestfulBase.php, line 1425
Contains RestfulBase.

Class

RestfulBase
Class \RestfulBase

Code

public function formatterNames() {
  $plugin_info = $this
    ->getPlugin();
  if (!empty($plugin_info['formatter'])) {

    // If there is formatter info in the plugin definition, return that.
    return array(
      $plugin_info['formatter'],
    );
  }

  // If there is no formatter info in the plugin definition, return a list
  // of all the formatters available.
  $formatter_names = array();
  foreach (restful_get_formatter_plugins() as $formatter_info) {
    $formatter_names[] = $formatter_info['name'];
  }
  return $formatter_names;
}