You are here

public function WebformCheckboxesOther::getElementSelectorOptions in Webform 6.x

Same name and namespace in other branches
  1. 8.5 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\WebformElement

Code

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,
  ];
}