You are here

public function WebformExampleElement::form in Webform 6.x

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

modules/webform_example_element/src/Plugin/WebformElement/WebformExampleElement.php, line 62

Class

WebformExampleElement
Provides a 'webform_example_element' element.

Namespace

Drupal\webform_example_element\Plugin\WebformElement

Code

public function form(array $form, FormStateInterface $form_state) {
  $form = parent::form($form, $form_state);

  // Here you can define and alter a webform element's properties UI.
  // Form element property visibility and default values are defined via
  // ::defaultProperties.
  //
  // @see \Drupal\webform\Plugin\WebformElementBase::form
  // @see \Drupal\webform\Plugin\WebformElement\TextBase::form
  return $form;
}