public function SourceOverviewForm::ajaxCallback

AJAX callback to refresh form.

Parameters

array $form:

FormStateInterface $form_state:

Return value

array Form element to replace.

File

src/Form/SourceOverviewForm.php, line 295

Class

SourceOverviewForm
Source overview form.

Namespace

Drupal\tmgmt\Form

Code

public function ajaxCallback(array &$form, FormStateInterface $form_state) {
  $source = $form_state
    ->getValue('source');
  $response = new AjaxResponse();
  $response
    ->addCommand(new RedirectCommand($this
    ->getUrlForSource($source)
    ->setAbsolute()
    ->toString()));
  return $response;
}