You are here

public function WebformMarkup::form in Webform 6.x

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

Gets the actual configuration webform array to be built.

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 An associative array contain the element's configuration webform without any default values.

Overrides WebformMarkupBase::form

File

src/Plugin/WebformElement/WebformMarkup.php, line 49

Class

WebformMarkup
Provides a 'webform_markup' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function form(array $form, FormStateInterface $form_state) {
  $form = parent::form($form, $form_state);
  $form['markup']['markup'] = [
    '#type' => 'webform_html_editor',
    '#title' => $this
      ->t('HTML markup'),
    '#description' => $this
      ->t('Enter custom HTML into your webform.'),
  ];
  return $form;
}