Radios.php in Webform 8.5
File
src/Plugin/WebformElement/Radios.php
View source
<?php
namespace Drupal\webform\Plugin\WebformElement;
class Radios extends OptionsBase {
protected function defineDefaultProperties() {
$properties = [
'options_display' => 'one_column',
'options_description_display' => 'description',
'options__properties' => [],
'wrapper_type' => 'fieldset',
] + parent::defineDefaultProperties();
unset($properties['format_items'], $properties['format_items_html'], $properties['format_items_text']);
return $properties;
}
public function setDefaultValue(array &$element) {
if (isset($element['#default_value']) && $element['#default_value'] === '' && !isset($element['#options'][$element['#default_value']])) {
unset($element['#default_value']);
}
}
}
Classes
Name |
Description |
Radios |
Provides a 'radios' element. |