You are here

public function CivicrmWebformHandler::alterForm in Webform CiviCRM Integration 8.5

Alter webform submission form.

Parameters

array $form: An associative array containing the structure of the form.

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

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

Overrides WebformHandlerBase::alterForm

File

src/Plugin/WebformHandler/CivicrmWebformHandler.php, line 109

Class

CivicrmWebformHandler
CiviCRM Webform Handler plugin.

Namespace

Drupal\webform_civicrm\Plugin\WebformHandler

Code

public function alterForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {
  $this->civicrm
    ->initialize();
  $settings = $this->configuration;
  $data = $settings['data'];
  $processor = \Drupal::service('webform_civicrm.preprocess')
    ->initialize($form, $form_state, $this);
  $processor
    ->alterForm();
}