You are here

public function SourceOverviewForm::ajaxCallback in Translation Management Tool 8

AJAX callback to refresh form.

Parameters

array $form:

FormStateInterface $form_state:

Return value

array Form element to replace.

File

src/Form/SourceOverviewForm.php, line 292

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;
}