public function DateTimeEnhancerBase::getSettingsForm in JSON:API Extras 8.3
Same name and namespace in other branches
- 8 src/Plugin/DateTimeEnhancerBase.php \Drupal\jsonapi_extras\Plugin\DateTimeEnhancerBase::getSettingsForm()
- 8.2 src/Plugin/DateTimeEnhancerBase.php \Drupal\jsonapi_extras\Plugin\DateTimeEnhancerBase::getSettingsForm()
Get a form element to render the settings.
Parameters
array $resource_field_info: The resource field info.
Return value
array The form element array.
Overrides ResourceFieldEnhancerBase::getSettingsForm
File
- src/
Plugin/ DateTimeEnhancerBase.php, line 31
Class
- DateTimeEnhancerBase
- Base class for date and time based resourceFieldEnhancer plugins.
Namespace
Drupal\jsonapi_extras\PluginCode
public function getSettingsForm(array $resource_field_info) {
$settings = empty($resource_field_info['enhancer']['settings']) ? $this
->getConfiguration() : $resource_field_info['enhancer']['settings'];
return [
'dateTimeFormat' => [
'#type' => 'textfield',
'#title' => $this
->t('Format'),
'#description' => $this
->t('Use a valid date format.'),
'#default_value' => $settings['dateTimeFormat'],
],
];
}