You are here

public function WebformDialogFormTrait::closeDialog in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Form/WebformDialogFormTrait.php \Drupal\webform\Form\WebformDialogFormTrait::closeDialog()

Close 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

bool|\Drupal\Core\Ajax\AjaxResponse An AJAX response that display validation error messages.

File

src/Form/WebformDialogFormTrait.php, line 154

Class

WebformDialogFormTrait
Trait class for Webform Ajax dialog support.

Namespace

Drupal\webform\Form

Code

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