You are here

public function WebformAnalysisForm::getComponents in Webform Analysis 8

Get Components.

Return value

array Components renderable.

1 call to WebformAnalysisForm::getComponents()
WebformAnalysisForm::buildForm in src/Form/WebformAnalysisForm.php
Form constructor.

File

src/Form/WebformAnalysisForm.php, line 90

Class

WebformAnalysisForm
Webform Analysis settings form.

Namespace

Drupal\webform_analysis\Form

Code

public function getComponents() {
  foreach ($this->analysis
    ->getElements() as $element_name => $element) {
    $options[$element_name] = isset($element['#title']) ? $element['#title'] : $element_name;
  }
  return [
    '#type' => 'checkboxes',
    '#options' => $options,
    '#default_value' => (array) $this->analysis
      ->getComponents(),
  ];
}