You are here

public function WebformTableTrait::form in Webform 8.5

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

File

src/Plugin/WebformElement/WebformTableTrait.php, line 76

Class

WebformTableTrait
Provides a 'table' trait.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function form(array $form, FormStateInterface $form_state) {
  $form = parent::form($form, $form_state);
  $form['options']['js_select'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Select all'),
    '#description' => $this
      ->t('If checked, a select all checkbox will be added to the header.'),
    '#return_value' => TRUE,
  ];
  $form['form']['display_container']['title_display']['#options'] = [
    'header' => $this
      ->t('Header'),
  ] + $form['form']['display_container']['title_display']['#options'];
  return $form;
}