You are here

public function YamlForm::getElementsSelectorOptions in YAML Form 8

Get form elements selectors as options.

Return value

array Form elements selectors as options.

Overrides YamlFormInterface::getElementsSelectorOptions

File

src/Entity/YamlForm.php, line 730

Class

YamlForm
Defines the form entity.

Namespace

Drupal\yamlform\Entity

Code

public function getElementsSelectorOptions() {

  /** @var \Drupal\yamlform\YamlFormElementManagerInterface $element_manager */
  $element_manager = \Drupal::service('plugin.manager.yamlform.element');
  $selectors = [];
  $elements = $this
    ->getElementsInitializedAndFlattened();
  foreach ($elements as $element) {
    $element_handler = $element_manager
      ->getElementInstance($element);
    $selectors += $element_handler
      ->getElementSelectorOptions($element);
  }
  return $selectors;
}