You are here

public function CloseBootstrap4ModalDialogCommand::__construct in Bootstrap 4 Modal 2.x

Same name and namespace in other branches
  1. 8 src/Ajax/CloseBootstrap4ModalDialogCommand.php \Drupal\bootstrap4_modal\Ajax\CloseBootstrap4ModalDialogCommand::__construct()

Constructs a CloseModalDialogCommand 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.

Overrides CloseModalDialogCommand::__construct

File

src/Ajax/CloseBootstrap4ModalDialogCommand.php, line 22

Class

CloseBootstrap4ModalDialogCommand
Defines an AJAX command that closes the currently visible modal dialog.

Namespace

Drupal\bootstrap4_modal\Ajax

Code

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