function webform_webform_options_range_alter in Webform 6.x
Same name and namespace in other branches
- 8.5 includes/webform.options.inc \webform_webform_options_range_alter()
Implements hook_webform_options_WEBFORM_OPTIONS_ID_alter() for range options.
See also
config/install/webform.webform.example_options.yml
File
- includes/
webform.options.inc, line 17 - Options alter hooks.
Code
function webform_webform_options_range_alter(array &$options, array $element = []) {
$element += [
'#min' => 1,
'#max' => 100,
'#step' => 1,
'#pad_length' => NULL,
'#pad_str' => 0,
];
$options = WebformOptionsHelper::range($element['#min'], $element['#max'], $element['#step'], $element['#pad_length'], $element['#pad_str']);
}