You are here

public static function WebformCiviCRMSettingsForm::pathstrAjaxRefresh in Webform CiviCRM Integration 8.5

AJAX callback for elements with a pathstr.

Parameters

array $form: The complete form.

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

Return value

array The form element to refresh.

File

src/Form/WebformCiviCRMSettingsForm.php, line 137

Class

WebformCiviCRMSettingsForm

Namespace

Drupal\webform_civicrm\Form

Code

public static function pathstrAjaxRefresh(array &$form, FormStateInterface $form_state) {
  $triggering_element = $form_state
    ->getTriggeringElement();
  $element = NestedArray::getValue($form, explode(':', $triggering_element['#ajax']['pathstr']));
  return $element;
}