You are here

public function WebformElement::form in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformElement.php \Drupal\webform\Plugin\WebformElement\WebformElement::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 WebformElementBase::form

File

src/Plugin/WebformElement/WebformElement.php, line 46

Class

WebformElement
Provides a 'generic' element. Used as a fallback.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function form(array $form, FormStateInterface $form_state) {
  $form['element'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('General settings'),
    '#open' => TRUE,
  ];
  return $form;
}