You are here

protected function ListIntegerItem::allowedValuesDescription in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php \Drupal\options\Plugin\Field\FieldType\ListIntegerItem::allowedValuesDescription()
  2. 9 core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php \Drupal\options\Plugin\Field\FieldType\ListIntegerItem::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/ListIntegerItem.php, line 53

Class

ListIntegerItem
Plugin implementation of the 'list_integer' 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, and must be numeric. The label will be used in displayed values and edit forms.');
  $description .= '<br/>' . t('The label is optional: if a line contains a single number, it will be used as key and label.');
  $description .= '<br/>' . t('Lists of labels are also accepted (one label per line), only if the field does not hold any values yet. Numeric keys will be automatically generated from the positions in the list.');
  $description .= '</p>';
  $description .= '<p>' . t('Allowed HTML tags in labels: @tags', [
    '@tags' => FieldFilteredMarkup::displayAllowedTags(),
  ]) . '</p>';
  return $description;
}