protected static function ListStringItem::validateAllowedValue in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php \Drupal\options\Plugin\Field\FieldType\ListStringItem::validateAllowedValue()
Checks whether a candidate allowed value is valid.
Parameters
string $option: The option value entered by the user.
Return value
string The error message if the specified value is invalid, NULL otherwise.
Overrides ListItemBase::validateAllowedValue
File
- core/
modules/ options/ src/ Plugin/ Field/ FieldType/ ListStringItem.php, line 72 - Contains \Drupal\options\Plugin\Field\FieldType\ListStringItem.
Class
- ListStringItem
- Plugin implementation of the 'list_string' field type.
Namespace
Drupal\options\Plugin\Field\FieldTypeCode
protected static function validateAllowedValue($option) {
if (Unicode::strlen($option) > 255) {
return t('Allowed values list: each key must be a string at most 255 characters long.');
}
}