You are here

public function WebformUiOptionsForm::editForm in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_ui/src/WebformUiOptionsForm.php \Drupal\webform_ui\WebformUiOptionsForm::editForm()

Edit webform options source code form.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides WebformOptionsForm::editForm

File

modules/webform_ui/src/WebformUiOptionsForm.php, line 17

Class

WebformUiOptionsForm
Base for controller for webform option UI.

Namespace

Drupal\webform_ui

Code

public function editForm(array $form, FormStateInterface $form_state) {
  $form['options'] = [
    '#type' => 'webform_options',
    '#mode' => 'yaml',
    '#title' => $this
      ->t('Options'),
    '#title_display' => 'invisible',
    '#description' => $this
      ->t("Descriptions, which are only applicable to radios and checkboxes, can be delimited using ' -- '."),
    '#description_display' => 'before',
    '#empty_options' => 10,
    '#add_more_items' => 10,
    '#default_value' => $this
      ->getOptions(),
  ];
  return $form;
}