function RestExport::getFormatOptions

Same name in other branches
  1. 9 core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::getFormatOptions()
  2. 8.9.x core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::getFormatOptions()
  3. 10 core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::getFormatOptions()

Returns an array of format options.

Return value

string[] An array of format options. Both key and value are the same.

1 call to RestExport::getFormatOptions()
RestExport::collectRoutes in core/modules/rest/src/Plugin/views/display/RestExport.php
Adds the route entry of a view to the collection.

File

core/modules/rest/src/Plugin/views/display/RestExport.php, line 483

Class

RestExport
The plugin that handles Data response callbacks for REST resources.

Namespace

Drupal\rest\Plugin\views\display

Code

protected function getFormatOptions() {
    $formats = array_keys($this->formatProviders);
    return array_combine($formats, $formats);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.