You are here

public function WebformAttachmentToken::form in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentToken.php \Drupal\webform_attachment\Plugin\WebformElement\WebformAttachmentToken::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 WebformAttachmentBase::form

File

modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentToken.php, line 33

Class

WebformAttachmentToken
Provides a 'webform_attachment_token' element.

Namespace

Drupal\webform_attachment\Plugin\WebformElement

Code

public function form(array $form, FormStateInterface $form_state) {
  $form = parent::form($form, $form_state);
  $form['attachment']['template'] = [
    '#type' => 'webform_codemirror',
    '#mode' => 'text',
    '#title' => $this
      ->t('Template'),
  ];
  return $form;
}