function ListStringItem::allowedValuesDescription

Same name in other branches
  1. 8.9.x core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php \Drupal\options\Plugin\Field\FieldType\ListStringItem::allowedValuesDescription()
  2. 10 core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php \Drupal\options\Plugin\Field\FieldType\ListStringItem::allowedValuesDescription()
  3. 11.x core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php \Drupal\options\Plugin\Field\FieldType\ListStringItem::allowedValuesDescription()

Overrides ListItemBase::allowedValuesDescription

File

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

Class

ListStringItem
Plugin implementation of the 'list_string' field type.

Namespace

Drupal\options\Plugin\Field\FieldType

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.