You are here

public function TestWebformHandler::alterElement in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php \Drupal\webform_test_handler\Plugin\WebformHandler\TestWebformHandler::alterElement()

Alter webform element.

Parameters

array $element: The webform element.

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

array $context: An associative array containing the following key-value pairs:

  • form: The form structure to which elements is being attached.

Overrides WebformHandlerBase::alterElement

See also

\Drupal\webform\WebformSubmissionForm::prepareElements()

hook_webform_element_alter()

File

tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php, line 67

Class

TestWebformHandler
Webform submission test handler.

Namespace

Drupal\webform_test_handler\Plugin\WebformHandler

Code

public function alterElement(array &$element, FormStateInterface $form_state, array $context) {
  $this
    ->displayMessage(__FUNCTION__);
}