protected function ServiceResourceOptionsTrait::getFormatOptions in Services 9.0.x
Same name and namespace in other branches
- 8.4 src/ServiceResourceOptionsTrait.php \Drupal\services\ServiceResourceOptionsTrait::getFormatOptions()
Get HTTP format options.
Return value
array An array of HTTP serializer format options.
2 calls to ServiceResourceOptionsTrait::getFormatOptions()
- ServiceResourceConfigForm::form in src/
Form/ ServiceResourceConfigForm.php - Gets the actual form array to be built.
- ServiceSettingsForm::buildForm in src/
Form/ ServiceSettingsForm.php - Form constructor.
File
- src/
ServiceResourceOptionsTrait.php, line 30
Class
Namespace
Drupal\servicesCode
protected function getFormatOptions() {
$formats = \Drupal::getContainer()
->getParameter('serializer.formats');
return array_combine($formats, $formats);
}