function CloseDialogCommand::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Ajax/CloseDialogCommand.php \Drupal\Core\Ajax\CloseDialogCommand::__construct()
  2. 10 core/lib/Drupal/Core/Ajax/CloseDialogCommand.php \Drupal\Core\Ajax\CloseDialogCommand::__construct()
  3. 11.x core/lib/Drupal/Core/Ajax/CloseDialogCommand.php \Drupal\Core\Ajax\CloseDialogCommand::__construct()

Constructs a CloseDialogCommand object.

Parameters

string $selector: A CSS selector string of the dialog to close.

bool $persist: (optional) Whether to persist the dialog in the DOM or not.

1 method overrides CloseDialogCommand::__construct()
CloseModalDialogCommand::__construct in core/lib/Drupal/Core/Ajax/CloseModalDialogCommand.php
Constructs a CloseModalDialogCommand object.

File

core/lib/Drupal/Core/Ajax/CloseDialogCommand.php, line 34

Class

CloseDialogCommand
Defines an AJAX command that closes the current active dialog.

Namespace

Drupal\Core\Ajax

Code

public function __construct($selector = NULL, $persist = FALSE) {
    $this->selector = $selector ? $selector : '#drupal-modal';
    $this->persist = $persist;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.