trait CloseDialogTrait in Purge 8.3
Shares the closeDialog AJAX form callback.
Hierarchy
- trait \Drupal\purge_ui\Form\CloseDialogTrait
See also
\Drupal\purge_ui\Form\PurgerAddForm
\Drupal\purge_ui\Form\DeletePurgerForm
\Drupal\purge_ui\Form\PurgerConfigFormBase
File
- modules/
purge_ui/ src/ Form/ CloseDialogTrait.php, line 16
Namespace
Drupal\purge_ui\FormView source
trait CloseDialogTrait {
/**
* Respond a CloseModalDialogCommand to close the modal dialog.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return \Drupal\Core\Ajax\AjaxResponse
* The AJAX response object.
*/
public function closeDialog(array &$form, FormStateInterface $form_state) {
$response = new AjaxResponse();
$response
->addCommand(new CloseModalDialogCommand());
return $response;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CloseDialogTrait:: |
public | function | Respond a CloseModalDialogCommand to close the modal dialog. |