YamlFormButtons.php in YAML Form 8
File
src/Element/YamlFormButtons.php
View source
<?php
namespace Drupal\yamlform\Element;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\Radios;
class YamlFormButtons extends Radios {
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;
}
}