function yamlform_preprocess_checkboxes in YAML Form 8
Prepares variables for checkboxes templates.
See also
\Drupal\yamlform\Plugin\YamlFormElement\OptionsBase
1 call to yamlform_preprocess_checkboxes()
- yamlform_preprocess_radios in ./
yamlform.module - Prepares variables for radios templates.
File
- ./
yamlform.module, line 530 - Enables the creation of forms and questionnaires.
Code
function yamlform_preprocess_checkboxes(&$variables) {
$element = $variables['element'];
$options_display = !empty($element['#options_display']) ? $element['#options_display'] : 'one_column';
$variables['attributes']['class'][] = 'yamlform-options-display-' . str_replace('_', '-', $options_display);
$variables['#attached']['library'][] = 'yamlform/yamlform.options';
}