You are here

protected function ListStringItem::allowedValuesDescription in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php \Drupal\options\Plugin\Field\FieldType\ListStringItem::allowedValuesDescription()
  2. 9 core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php \Drupal\options\Plugin\Field\FieldType\ListStringItem::allowedValuesDescription()

Provides the field type specific allowed values form element #description.

Return value

string The field type allowed values form specific description.

Overrides ListItemBase::allowedValuesDescription

File

core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php, line 55

Class

ListStringItem
Plugin implementation of the 'list_string' field type.

Namespace

Drupal\options\Plugin\Field\FieldType

Code

protected function allowedValuesDescription() {
  $description = '<p>' . t('The possible values this field can contain. Enter one value per line, in the format key|label.');
  $description .= '<br/>' . t('The key is the stored value. The label will be used in displayed values and edit forms.');
  $description .= '<br/>' . t('The label is optional: if a line contains a single string, it will be used as key and label.');
  $description .= '</p>';
  $description .= '<p>' . t('Allowed HTML tags in labels: @tags', [
    '@tags' => FieldFilteredMarkup::displayAllowedTags(),
  ]) . '</p>';
  return $description;
}