You are here

public static function YamlFormButtons::processRadios in YAML Form 8

Expands a radios element into individual radio elements.

Overrides Radios::processRadios

File

src/Element/YamlFormButtons.php, line 18

Class

YamlFormButtons
Provides a form element for buttons with an other option.

Namespace

Drupal\yamlform\Element

Code

public static function processRadios(&$element, FormStateInterface $form_state, &$complete_form) {
  $element = parent::processRadios($element, $form_state, $complete_form);
  $element['#attached']['library'][] = 'yamlform/yamlform.element.buttons';
  $element['#attributes']['class'][] = 'js-yamlform-buttons';
  $element['#attributes']['class'][] = 'yamlform-buttons';
  $element['#options_display'] = 'side_by_side';
  return $element;
}