You are here

protected function Checkboxes::getElementSelectorInputsOptions in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElement/Checkboxes.php \Drupal\webform\Plugin\WebformElement\Checkboxes::getElementSelectorInputsOptions()

Get an element's (sub)inputs selectors as options.

Parameters

array $element: An element.

Return value

array An array of element (sub)input selectors.

Overrides OptionsBase::getElementSelectorInputsOptions

1 call to Checkboxes::getElementSelectorInputsOptions()
WebformTermCheckboxes::getElementSelectorInputsOptions in src/Plugin/WebformElement/WebformTermCheckboxes.php
Get an element's (sub)inputs selectors as options.

File

src/Plugin/WebformElement/Checkboxes.php, line 136

Class

Checkboxes
Provides a 'checkboxes' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function getElementSelectorInputsOptions(array $element) {
  $selectors = $element['#options'];
  foreach ($selectors as $index => $text) {

    // Remove description from text.
    list($text) = WebformOptionsHelper::splitOption($text);

    // Append element type to text.
    $text .= ' [' . $this
      ->t('Checkbox') . ']';
    $selectors[$index] = $text;
  }
  return $selectors;
}