protected function CountryItem::defaultCountriesForm in Country 8
Builds the selectable_countries element.
Parameters
array $element: The form associative array passed by reference.
array $settings: The field settings array.
1 call to CountryItem::defaultCountriesForm()
- CountryItem::storageSettingsForm in src/
Plugin/ Field/ FieldType/ CountryItem.php - Returns a form for the storage-level settings.
File
- src/
Plugin/ Field/ FieldType/ CountryItem.php, line 131
Class
- CountryItem
- Plugin implementation of the 'country' field type.
Namespace
Drupal\country\Plugin\Field\FieldTypeCode
protected function defaultCountriesForm(array &$element, array $settings) {
$element['selectable_countries'] = [
'#type' => 'select',
'#title' => t('Selectable countries'),
'#default_value' => $settings['selectable_countries'],
'#options' => $this
->getPossibleOptions(),
'#description' => t('Select all countries you want to make available for this field.'),
'#multiple' => TRUE,
'#size' => 10,
];
}