You are here

public function CloseDialogTrait::closeDialog in Purge 8.3

Respond a CloseModalDialogCommand to close the modal dialog.

Parameters

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

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

Return value

\Drupal\Core\Ajax\AjaxResponse The AJAX response object.

File

modules/purge_ui/src/Form/CloseDialogTrait.php, line 29

Class

CloseDialogTrait
Shares the closeDialog AJAX form callback.

Namespace

Drupal\purge_ui\Form

Code

public function closeDialog(array &$form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $response
    ->addCommand(new CloseModalDialogCommand());
  return $response;
}