public function AjaxController::handle in Webform CiviCRM Integration 8.5
Handles the ajax request.
Parameters
string $operation: The operation to perform: stateProvince or county
1 string reference to 'AjaxController::handle'
File
- src/
Controller/ AjaxController.php, line 43
Class
Namespace
Drupal\webform_civicrm\ControllerCode
public function handle($key, $input = '', $isBilling = FALSE) {
$this->civicrm
->initialize();
if ($key === 'stateProvince') {
$isBilling = $isBilling === 'false' ? FALSE : $isBilling;
return $this
->stateProvince($input, $isBilling);
}
elseif ($key === 'county') {
return $this
->county($input);
}
else {
$processor = \Drupal::service('webform_civicrm.webform_ajax');
return new JsonResponse($processor
->contactAjax($key, $input));
}
}