public function WebformCheckboxesOther::getElementSelectorOptions in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElement/WebformCheckboxesOther.php \Drupal\webform\Plugin\WebformElement\WebformCheckboxesOther::getElementSelectorOptions()
Overrides OptionsBase::getElementSelectorOptions
See also
\Drupal\webform\Entity\Webform::getElementsSelectorOptions
File
- src/
Plugin/ WebformElement/ WebformCheckboxesOther.php, line 40
Class
- WebformCheckboxesOther
- Provides a 'checkboxes_other' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function getElementSelectorOptions(array $element) {
$title = $this
->getAdminLabel($element);
$name = $element['#webform_key'];
$selectors = [];
foreach ($element['#options'] as $input_name => $input_title) {
$selectors[":input[name=\"{$name}[checkboxes][{$input_name}]\"]"] = $input_title . ' [' . $this
->t('Checkboxes') . ']';
}
$selectors[":input[name=\"{$name}[other]\"]"] = $title . ' [' . $this
->t('Textfield') . ']';
return [
$title => $selectors,
];
}